rust/src/test/ui/borrowck/borrowck-asm.stderr

82 lines
2.9 KiB
Plaintext
Raw Normal View History

2018-08-08 07:28:26 -05:00
error[E0382]: use of moved value: `x`
2021-07-29 12:45:13 -05:00
--> $DIR/borrowck-asm.rs:26:17
2018-08-08 07:28:26 -05:00
|
2019-01-24 12:53:43 -06:00
LL | let x = &mut 0isize;
| - move occurs because `x` has type `&mut isize`, which does not implement the `Copy` trait
LL | unsafe {
2020-02-14 10:54:40 -06:00
LL | llvm_asm!("nop" : : "r"(x));
| - value moved here
2018-08-08 07:28:26 -05:00
LL | }
LL | let z = x;
2018-08-08 07:28:26 -05:00
| ^ value used here after move
error[E0503]: cannot use `x` because it was mutably borrowed
2021-07-29 12:45:13 -05:00
--> $DIR/borrowck-asm.rs:33:37
2018-08-08 07:28:26 -05:00
|
LL | let y = &mut x;
| ------ borrow of `x` occurs here
LL | unsafe {
2020-02-14 10:54:40 -06:00
LL | llvm_asm!("nop" : : "r"(x));
| ^ use of borrowed `x`
LL | }
2018-08-08 07:28:26 -05:00
LL | let z = y;
| - borrow later used here
error[E0384]: cannot assign twice to immutable variable `x`
2021-07-29 12:45:13 -05:00
--> $DIR/borrowck-asm.rs:41:36
2018-08-08 07:28:26 -05:00
|
LL | let x = 3;
| -
| |
| first assignment to `x`
| help: consider making this binding mutable: `mut x`
2018-08-08 07:28:26 -05:00
LL | unsafe {
2020-02-14 10:54:40 -06:00
LL | llvm_asm!("nop" : "=r"(x));
| ^ cannot assign twice to immutable variable
2018-08-08 07:28:26 -05:00
error[E0384]: cannot assign twice to immutable variable `x`
2021-07-29 12:45:13 -05:00
--> $DIR/borrowck-asm.rs:55:36
2018-08-08 07:28:26 -05:00
|
LL | let x = 3;
| -
| |
| first assignment to `x`
| help: consider making this binding mutable: `mut x`
2018-08-08 07:28:26 -05:00
LL | unsafe {
2020-02-14 10:54:40 -06:00
LL | llvm_asm!("nop" : "+r"(x));
| ^ cannot assign twice to immutable variable
2018-08-08 07:28:26 -05:00
error[E0381]: use of possibly-uninitialized variable: `x`
2021-07-29 12:45:13 -05:00
--> $DIR/borrowck-asm.rs:62:37
2018-08-08 07:28:26 -05:00
|
2020-02-14 10:54:40 -06:00
LL | llvm_asm!("nop" : "=*r"(x));
| ^ use of possibly-uninitialized `x`
2018-08-08 07:28:26 -05:00
error[E0506]: cannot assign to `x` because it is borrowed
2021-07-29 12:45:13 -05:00
--> $DIR/borrowck-asm.rs:70:36
2018-08-08 07:28:26 -05:00
|
LL | let y = &*x;
| --- borrow of `x` occurs here
LL | unsafe {
2020-02-14 10:54:40 -06:00
LL | llvm_asm!("nop" : "+r"(x));
| ^ assignment to borrowed `x` occurs here
LL | }
2018-08-08 07:28:26 -05:00
LL | let z = y;
| - borrow later used here
error[E0382]: use of moved value: `x`
2021-07-29 12:45:13 -05:00
--> $DIR/borrowck-asm.rs:78:45
2018-08-08 07:28:26 -05:00
|
2019-01-24 12:53:43 -06:00
LL | let x = &mut 2;
| - move occurs because `x` has type `&mut i32`, which does not implement the `Copy` trait
LL | unsafe {
2020-02-14 10:54:40 -06:00
LL | llvm_asm!("nop" : : "r"(x), "r"(x) );
| - ^ value used here after move
| |
| value moved here
2018-08-08 07:28:26 -05:00
error: aborting due to 7 previous errors
Some errors have detailed explanations: E0381, E0382, E0384, E0503, E0506.
2018-08-08 07:28:26 -05:00
For more information about an error, try `rustc --explain E0381`.