]> git.proxmox.com Git - rustc.git/blob - src/test/ui/borrowck/borrowck-asm.ast.nll.stderr
New upstream version 1.33.0+dfsg1
[rustc.git] / src / test / ui / borrowck / borrowck-asm.ast.nll.stderr
1 error[E0382]: use of moved value: `x`
2 --> $DIR/borrowck-asm.rs:27:17
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:35: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 LL | let z = y;
22 | - borrow later used here
23
24 error[E0384]: cannot assign twice to immutable variable `x`
25 --> $DIR/borrowck-asm.rs:44:31
26 |
27 LL | let x = 3;
28 | -
29 | |
30 | first assignment to `x`
31 | help: make this binding mutable: `mut x`
32 LL | unsafe {
33 LL | asm!("nop" : "=r"(x)); //[ast]~ ERROR cannot assign twice
34 | ^ cannot assign twice to immutable variable
35
36 error[E0384]: cannot assign twice to immutable variable `x`
37 --> $DIR/borrowck-asm.rs:60:31
38 |
39 LL | let x = 3;
40 | -
41 | |
42 | first assignment to `x`
43 | help: make this binding mutable: `mut 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:68: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:77: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 LL | let z = y;
64 | - borrow later used here
65
66 error[E0382]: use of moved value: `x`
67 --> $DIR/borrowck-asm.rs:86:40
68 |
69 LL | asm!("nop" : : "r"(x), "r"(x) ); //[ast]~ ERROR use of moved value
70 | - ^ value used here after move
71 | |
72 | value moved here
73 |
74 = note: move occurs because `x` has type `&mut i32`, which does not implement the `Copy` trait
75
76 error: aborting due to 7 previous errors
77
78 Some errors occurred: E0381, E0382, E0384, E0503, E0506.
79 For more information about an error, try `rustc --explain E0381`.