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