]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/borrowck/borrowck-asm.mir.stderr
When using value after move, point at span of local
[rust.git] / src / test / ui / borrowck / borrowck-asm.mir.stderr
index 0cec1975db8805e7b1d6bfbdfc034452914fdf14..86e4832b3873ce49ae1bc09a2247e1b3e5af6fde 100644 (file)
@@ -1,16 +1,17 @@
 error[E0382]: use of moved value: `x`
-  --> $DIR/borrowck-asm.rs:37:17
+  --> $DIR/borrowck-asm.rs:27: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;  //[ast]~ ERROR use of moved value: `x`
    |                 ^ value used here after move
-   |
-   = note: move occurs because `x` has type `&mut isize`, which does not implement the `Copy` trait
 
 error[E0503]: cannot use `x` because it was mutably borrowed
-  --> $DIR/borrowck-asm.rs:45:32
+  --> $DIR/borrowck-asm.rs:35:32
    |
 LL |         let y = &mut x;
    |                 ------ borrow of `x` occurs here
@@ -22,7 +23,7 @@ LL |         let z = y;
    |                 - borrow later used here
 
 error[E0384]: cannot assign twice to immutable variable `x`
-  --> $DIR/borrowck-asm.rs:54:31
+  --> $DIR/borrowck-asm.rs:44:31
    |
 LL |         let x = 3;
    |             -
@@ -34,7 +35,7 @@ LL |             asm!("nop" : "=r"(x));  //[ast]~ ERROR cannot assign twice
    |                               ^ cannot assign twice to immutable variable
 
 error[E0384]: cannot assign twice to immutable variable `x`
-  --> $DIR/borrowck-asm.rs:70:31
+  --> $DIR/borrowck-asm.rs:60:31
    |
 LL |         let x = 3;
    |             -
@@ -46,13 +47,13 @@ LL |             asm!("nop" : "+r"(x));  //[ast]~ ERROR cannot assign twice
    |                               ^ cannot assign twice to immutable variable
 
 error[E0381]: use of possibly uninitialized variable: `x`
-  --> $DIR/borrowck-asm.rs:78:32
+  --> $DIR/borrowck-asm.rs:68:32
    |
 LL |             asm!("nop" : "=*r"(x)); //[ast]~ ERROR use of possibly uninitialized variable
    |                                ^ use of possibly uninitialized `x`
 
 error[E0506]: cannot assign to `x` because it is borrowed
-  --> $DIR/borrowck-asm.rs:87:31
+  --> $DIR/borrowck-asm.rs:77:31
    |
 LL |         let y = &*x;
    |                 --- borrow of `x` occurs here
@@ -64,14 +65,15 @@ LL |         let z = y;
    |                 - borrow later used here
 
 error[E0382]: use of moved value: `x`
-  --> $DIR/borrowck-asm.rs:96:40
+  --> $DIR/borrowck-asm.rs:86: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) );    //[ast]~ ERROR use of moved value
    |                                -       ^ value used here after move
    |                                |
    |                                value moved here
-   |
-   = note: move occurs because `x` has type `&mut i32`, which does not implement the `Copy` trait
 
 error: aborting due to 7 previous errors