| error[E0382]: use of moved value: `x` |
| --> $DIR/borrowck-asm.rs:24:17 |
| | |
| LL | let x = &mut 0isize; |
| | - move occurs because `x` has type `&mut isize`, which does not implement the `Copy` trait |
| LL | unsafe { |
| LL | asm!("nop" : : "r"(x)); |
| | - value moved here |
| LL | } |
| LL | let z = x; |
| | ^ value used here after move |
| |
| error[E0503]: cannot use `x` because it was mutably borrowed |
| --> $DIR/borrowck-asm.rs:31:32 |
| | |
| LL | let y = &mut x; |
| | ------ borrow of `x` occurs here |
| LL | unsafe { |
| LL | asm!("nop" : : "r"(x)); |
| | ^ use of borrowed `x` |
| LL | } |
| LL | let z = y; |
| | - borrow later used here |
| |
| error[E0384]: cannot assign twice to immutable variable `x` |
| --> $DIR/borrowck-asm.rs:39:31 |
| | |
| LL | let x = 3; |
| | - |
| | | |
| | first assignment to `x` |
| | help: make this binding mutable: `mut x` |
| LL | unsafe { |
| LL | asm!("nop" : "=r"(x)); |
| | ^ cannot assign twice to immutable variable |
| |
| error[E0384]: cannot assign twice to immutable variable `x` |
| --> $DIR/borrowck-asm.rs:53:31 |
| | |
| LL | let x = 3; |
| | - |
| | | |
| | first assignment to `x` |
| | help: make this binding mutable: `mut x` |
| LL | unsafe { |
| LL | asm!("nop" : "+r"(x)); |
| | ^ cannot assign twice to immutable variable |
| |
| error[E0381]: use of possibly-uninitialized variable: `x` |
| --> $DIR/borrowck-asm.rs:60:32 |
| | |
| LL | asm!("nop" : "=*r"(x)); |
| | ^ use of possibly-uninitialized `x` |
| |
| error[E0506]: cannot assign to `x` because it is borrowed |
| --> $DIR/borrowck-asm.rs:68:31 |
| | |
| LL | let y = &*x; |
| | --- borrow of `x` occurs here |
| LL | unsafe { |
| LL | asm!("nop" : "+r"(x)); |
| | ^ assignment to borrowed `x` occurs here |
| LL | } |
| LL | let z = y; |
| | - borrow later used here |
| |
| error[E0382]: use of moved value: `x` |
| --> $DIR/borrowck-asm.rs:76:40 |
| | |
| LL | let x = &mut 2; |
| | - move occurs because `x` has type `&mut i32`, which does not implement the `Copy` trait |
| LL | unsafe { |
| LL | asm!("nop" : : "r"(x), "r"(x) ); |
| | - ^ value used here after move |
| | | |
| | value moved here |
| |
| error: aborting due to 7 previous errors |
| |
| Some errors have detailed explanations: E0381, E0382, E0384, E0503, E0506. |
| For more information about an error, try `rustc --explain E0381`. |