]> git.proxmox.com Git - rustc.git/blob - src/test/ui/borrowck/borrowck-asm.ast.stderr
New upstream version 1.31.0~beta.4+dfsg1
[rustc.git] / src / test / ui / borrowck / borrowck-asm.ast.stderr
1 error[E0382]: use of moved value: `x`
2 --> $DIR/borrowck-asm.rs:37:13
3 |
4 LL | asm!("nop" : : "r"(x));
5 | - value moved here
6 LL | }
7 LL | let z = x; //[ast]~ ERROR use of moved value: `x`
8 | ^ value used here after move
9 |
10 = note: move occurs because `x` has type `&mut isize`, which does not implement the `Copy` trait
11
12 error[E0503]: cannot use `x` because it was mutably borrowed
13 --> $DIR/borrowck-asm.rs:45:32
14 |
15 LL | let y = &mut x;
16 | - borrow of `x` occurs here
17 LL | unsafe {
18 LL | asm!("nop" : : "r"(x)); //[ast]~ ERROR cannot use
19 | ^ use of borrowed `x`
20
21 error[E0384]: cannot assign twice to immutable variable `x`
22 --> $DIR/borrowck-asm.rs:54:31
23 |
24 LL | let x = 3;
25 | - first assignment to `x`
26 LL | unsafe {
27 LL | asm!("nop" : "=r"(x)); //[ast]~ ERROR cannot assign twice
28 | ^ cannot assign twice to immutable variable
29
30 error[E0506]: cannot assign to `a` because it is borrowed
31 --> $DIR/borrowck-asm.rs:60:31
32 |
33 LL | let b = &*a;
34 | -- borrow of `a` occurs here
35 LL | unsafe {
36 LL | asm!("nop" : "=r"(a)); //[ast]~ ERROR cannot assign to `a` because it is borrowed
37 | ^ assignment to borrowed `a` occurs here
38
39 error[E0384]: cannot assign twice to immutable variable `x`
40 --> $DIR/borrowck-asm.rs:70:31
41 |
42 LL | let x = 3;
43 | - first assignment to `x`
44 LL | unsafe {
45 LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign twice
46 | ^ cannot assign twice to immutable variable
47
48 error[E0381]: use of possibly uninitialized variable: `x`
49 --> $DIR/borrowck-asm.rs:78:32
50 |
51 LL | asm!("nop" : "=*r"(x)); //[ast]~ ERROR use of possibly uninitialized variable
52 | ^ use of possibly uninitialized `x`
53
54 error[E0506]: cannot assign to `x` because it is borrowed
55 --> $DIR/borrowck-asm.rs:87:31
56 |
57 LL | let y = &*x;
58 | -- borrow of `x` occurs here
59 LL | unsafe {
60 LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign to `x` because it is borrowed
61 | ^ assignment to borrowed `x` occurs here
62
63 error[E0382]: use of moved value: `x`
64 --> $DIR/borrowck-asm.rs:96:40
65 |
66 LL | asm!("nop" : : "r"(x), "r"(x) ); //[ast]~ ERROR use of moved value
67 | - ^ value used here after move
68 | |
69 | value moved here
70 |
71 = note: move occurs because `x` has type `&mut i32`, which does not implement the `Copy` trait
72
73 error: aborting due to 8 previous errors
74
75 Some errors occurred: E0381, E0382, E0384, E0503, E0506.
76 For more information about an error, try `rustc --explain E0381`.