about summary refs log tree commit diff
path: root/src/test/ui/borrowck
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2018-11-09 00:26:28 +0100
committerFelix S. Klock II <pnkfelix@pnkfx.org>2018-11-09 00:26:28 +0100
commit9b6a568c6f32af27bc050b7df0dabe4c5c9aefee (patch)
tree90925b1e8ca39ccb66851b5aebf50206930803d8 /src/test/ui/borrowck
parentd0151cac17cab1f88f4c3d27ac8cbb8e53f3fab6 (diff)
downloadrust-9b6a568c6f32af27bc050b7df0dabe4c5c9aefee.tar.gz
rust-9b6a568c6f32af27bc050b7df0dabe4c5c9aefee.zip
Fix the expected error annotations.
(The commit prior to this actual passes our test suite, "thanks"
to #55695. But since I am aware of that bug, I took advantage of it
in choosing how to order my commit series...)
Diffstat (limited to 'src/test/ui/borrowck')
-rw-r--r--src/test/ui/borrowck/borrowck-box-insensitivity.ast.stderr42
-rw-r--r--src/test/ui/borrowck/borrowck-box-insensitivity.mir.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-box-insensitivity.rs86
3 files changed, 65 insertions, 65 deletions
diff --git a/src/test/ui/borrowck/borrowck-box-insensitivity.ast.stderr b/src/test/ui/borrowck/borrowck-box-insensitivity.ast.stderr
index b84bae748ee..95b26a5724a 100644
--- a/src/test/ui/borrowck/borrowck-box-insensitivity.ast.stderr
+++ b/src/test/ui/borrowck/borrowck-box-insensitivity.ast.stderr
@@ -3,8 +3,8 @@ error[E0382]: use of moved value: `a`
    |
 LL |     let _x = a.x;
    |         -- value moved here
-LL |     //~^ value moved here
-LL |     let _y = a.y; //~ ERROR use of moved
+LL |     //[ast]~^ value moved here
+LL |     let _y = a.y; //[ast]~ ERROR use of moved
    |         ^^ value used here after move
    |
    = note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
@@ -14,8 +14,8 @@ error[E0382]: use of moved value: `a`
    |
 LL |     let _x = a.x;
    |         -- value moved here
-LL |     //~^ value moved here
-LL |     let _y = a.y; //~ ERROR use of moved
+LL |     //[ast]~^ value moved here
+LL |     let _y = a.y; //[ast]~ ERROR use of moved
    |         ^^ value used here after move
    |
    = note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
@@ -25,8 +25,8 @@ error[E0382]: use of moved value: `a`
    |
 LL |     let _x = a.x;
    |         -- value moved here
-LL |     //~^ value moved here
-LL |     let _y = &a.y; //~ ERROR use of moved
+LL |     //[ast]~^ value moved here
+LL |     let _y = &a.y; //[ast]~ ERROR use of moved
    |               ^^^ value used here after move
    |
    = note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
@@ -44,7 +44,7 @@ error[E0503]: cannot use `a.y` because it was mutably borrowed
    |
 LL |     let _x = &mut a.x;
    |                   --- borrow of `a.x` occurs here
-LL |     let _y = a.y; //~ ERROR cannot use
+LL |     let _y = a.y; //[ast]~ ERROR cannot use
    |         ^^ use of borrowed `a.x`
 
 error[E0505]: cannot move out of `a.y` because it is borrowed
@@ -60,7 +60,7 @@ error[E0502]: cannot borrow `a` (via `a.y`) as immutable because `a` is also bor
    |
 LL |     let _x = &mut a.x;
    |                   --- mutable borrow occurs here (via `a.x`)
-LL |     let _y = &a.y; //~ ERROR cannot borrow
+LL |     let _y = &a.y; //[ast]~ ERROR cannot borrow
    |               ^^^ immutable borrow occurs here (via `a.y`)
 ...
 LL | }
@@ -71,7 +71,7 @@ error[E0502]: cannot borrow `a` (via `a.y`) as mutable because `a` is also borro
    |
 LL |     let _x = &a.x;
    |               --- immutable borrow occurs here (via `a.x`)
-LL |     let _y = &mut a.y; //~ ERROR cannot borrow
+LL |     let _y = &mut a.y; //[ast]~ ERROR cannot borrow
    |                   ^^^ mutable borrow occurs here (via `a.y`)
 ...
 LL | }
@@ -82,8 +82,8 @@ error[E0382]: use of collaterally moved value: `a.y`
    |
 LL |     let _x = a.x.x;
    |         -- value moved here
-LL |     //~^ value moved here
-LL |     let _y = a.y; //~ ERROR use of collaterally moved
+LL |     //[ast]~^ value moved here
+LL |     let _y = a.y; //[ast]~ ERROR use of collaterally moved
    |         ^^ value used here after move
    |
    = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
@@ -93,8 +93,8 @@ error[E0382]: use of collaterally moved value: `a.y`
    |
 LL |     let _x = a.x.x;
    |         -- value moved here
-LL |     //~^ value moved here
-LL |     let _y = a.y; //~ ERROR use of collaterally moved
+LL |     //[ast]~^ value moved here
+LL |     let _y = a.y; //[ast]~ ERROR use of collaterally moved
    |         ^^ value used here after move
    |
    = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
@@ -104,8 +104,8 @@ error[E0382]: use of collaterally moved value: `a.y`
    |
 LL |     let _x = a.x.x;
    |         -- value moved here
-LL |     //~^ value moved here
-LL |     let _y = &a.y; //~ ERROR use of collaterally moved
+LL |     //[ast]~^ value moved here
+LL |     let _y = &a.y; //[ast]~ ERROR use of collaterally moved
    |               ^^^ value used here after move
    |
    = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
@@ -115,7 +115,7 @@ error[E0505]: cannot move out of `a.y` because it is borrowed
    |
 LL |     let _x = &a.x.x;
    |               ----- borrow of `a.x.x` occurs here
-LL |     //~^ borrow of `a.x.x` occurs here
+LL |     //[ast]~^ borrow of `a.x.x` occurs here
 LL |     let _y = a.y;
    |         ^^ move out of `a.y` occurs here
 
@@ -124,7 +124,7 @@ error[E0503]: cannot use `a.y` because it was mutably borrowed
    |
 LL |     let _x = &mut a.x.x;
    |                   ----- borrow of `a.x.x` occurs here
-LL |     let _y = a.y; //~ ERROR cannot use
+LL |     let _y = a.y; //[ast]~ ERROR cannot use
    |         ^^ use of borrowed `a.x.x`
 
 error[E0505]: cannot move out of `a.y` because it is borrowed
@@ -140,8 +140,8 @@ error[E0502]: cannot borrow `a.y` as immutable because `a.x.x` is also borrowed
    |
 LL |     let _x = &mut a.x.x;
    |                   ----- mutable borrow occurs here
-LL |     //~^ mutable borrow occurs here
-LL |     let _y = &a.y; //~ ERROR cannot borrow
+LL |     //[ast]~^ mutable borrow occurs here
+LL |     let _y = &a.y; //[ast]~ ERROR cannot borrow
    |               ^^^ immutable borrow occurs here
 ...
 LL | }
@@ -152,8 +152,8 @@ error[E0502]: cannot borrow `a.y` as mutable because `a.x.x` is also borrowed as
    |
 LL |     let _x = &a.x.x;
    |               ----- immutable borrow occurs here
-LL |     //~^ immutable borrow occurs here
-LL |     let _y = &mut a.y; //~ ERROR cannot borrow
+LL |     //[ast]~^ immutable borrow occurs here
+LL |     let _y = &mut a.y; //[ast]~ ERROR cannot borrow
    |                   ^^^ mutable borrow occurs here
 ...
 LL | }
diff --git a/src/test/ui/borrowck/borrowck-box-insensitivity.mir.stderr b/src/test/ui/borrowck/borrowck-box-insensitivity.mir.stderr
index 0e380e90e75..171e992e8a6 100644
--- a/src/test/ui/borrowck/borrowck-box-insensitivity.mir.stderr
+++ b/src/test/ui/borrowck/borrowck-box-insensitivity.mir.stderr
@@ -1,7 +1,7 @@
 error: compilation successful
   --> $DIR/borrowck-box-insensitivity.rs:160:1
    |
-LL | / fn main() {
+LL | / fn main() { //[mir]~ ERROR compilation successful
 LL | |     copy_after_move();
 LL | |     move_after_move();
 LL | |     borrow_after_move();
diff --git a/src/test/ui/borrowck/borrowck-box-insensitivity.rs b/src/test/ui/borrowck/borrowck-box-insensitivity.rs
index 1f1a7ea5ad9..2af97a9fc1d 100644
--- a/src/test/ui/borrowck/borrowck-box-insensitivity.rs
+++ b/src/test/ui/borrowck/borrowck-box-insensitivity.rs
@@ -33,131 +33,131 @@ struct D {
 fn copy_after_move() {
     let a: Box<_> = box A { x: box 0, y: 1 };
     let _x = a.x;
-    //~^ value moved here
-    let _y = a.y; //~ ERROR use of moved
-    //~^ move occurs because `a.x` has type `std::boxed::Box<isize>`
-    //~| value used here after move
+    //[ast]~^ value moved here
+    let _y = a.y; //[ast]~ ERROR use of moved
+    //[ast]~^ move occurs because `a.x` has type `std::boxed::Box<isize>`
+    //[ast]~| value used here after move
 }
 
 fn move_after_move() {
     let a: Box<_> = box B { x: box 0, y: box 1 };
     let _x = a.x;
-    //~^ value moved here
-    let _y = a.y; //~ ERROR use of moved
-    //~^ move occurs because `a.x` has type `std::boxed::Box<isize>`
-    //~| value used here after move
+    //[ast]~^ value moved here
+    let _y = a.y; //[ast]~ ERROR use of moved
+    //[ast]~^ move occurs because `a.x` has type `std::boxed::Box<isize>`
+    //[ast]~| value used here after move
 }
 
 fn borrow_after_move() {
     let a: Box<_> = box A { x: box 0, y: 1 };
     let _x = a.x;
-    //~^ value moved here
-    let _y = &a.y; //~ ERROR use of moved
-    //~^ move occurs because `a.x` has type `std::boxed::Box<isize>`
-    //~| value used here after move
+    //[ast]~^ value moved here
+    let _y = &a.y; //[ast]~ ERROR use of moved
+    //[ast]~^ move occurs because `a.x` has type `std::boxed::Box<isize>`
+    //[ast]~| value used here after move
 }
 
 fn move_after_borrow() {
     let a: Box<_> = box B { x: box 0, y: box 1 };
     let _x = &a.x;
     let _y = a.y;
-    //~^ ERROR cannot move
-    //~| move out of
+    //[ast]~^ ERROR cannot move
+    //[ast]~| move out of
     use_imm(_x);
 }
 fn copy_after_mut_borrow() {
     let mut a: Box<_> = box A { x: box 0, y: 1 };
     let _x = &mut a.x;
-    let _y = a.y; //~ ERROR cannot use
+    let _y = a.y; //[ast]~ ERROR cannot use
     use_mut(_x);
 }
 fn move_after_mut_borrow() {
     let mut a: Box<_> = box B { x: box 0, y: box 1 };
     let _x = &mut a.x;
     let _y = a.y;
-    //~^ ERROR cannot move
-    //~| move out of
+    //[ast]~^ ERROR cannot move
+    //[ast]~| move out of
     use_mut(_x);
 }
 fn borrow_after_mut_borrow() {
     let mut a: Box<_> = box A { x: box 0, y: 1 };
     let _x = &mut a.x;
-    let _y = &a.y; //~ ERROR cannot borrow
-    //~^ immutable borrow occurs here (via `a.y`)
+    let _y = &a.y; //[ast]~ ERROR cannot borrow
+    //[ast]~^ immutable borrow occurs here (via `a.y`)
     use_mut(_x);
 }
 fn mut_borrow_after_borrow() {
     let mut a: Box<_> = box A { x: box 0, y: 1 };
     let _x = &a.x;
-    let _y = &mut a.y; //~ ERROR cannot borrow
-    //~^ mutable borrow occurs here (via `a.y`)
+    let _y = &mut a.y; //[ast]~ ERROR cannot borrow
+    //[ast]~^ mutable borrow occurs here (via `a.y`)
     use_imm(_x);
 }
 fn copy_after_move_nested() {
     let a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 };
     let _x = a.x.x;
-    //~^ value moved here
-    let _y = a.y; //~ ERROR use of collaterally moved
-    //~| value used here after move
+    //[ast]~^ value moved here
+    let _y = a.y; //[ast]~ ERROR use of collaterally moved
+    //[ast]~| value used here after move
 }
 
 fn move_after_move_nested() {
     let a: Box<_> = box D { x: box A { x: box 0, y: 1 }, y: box 2 };
     let _x = a.x.x;
-    //~^ value moved here
-    let _y = a.y; //~ ERROR use of collaterally moved
-    //~| value used here after move
+    //[ast]~^ value moved here
+    let _y = a.y; //[ast]~ ERROR use of collaterally moved
+    //[ast]~| value used here after move
 }
 
 fn borrow_after_move_nested() {
     let a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 };
     let _x = a.x.x;
-    //~^ value moved here
-    let _y = &a.y; //~ ERROR use of collaterally moved
-    //~| value used here after move
+    //[ast]~^ value moved here
+    let _y = &a.y; //[ast]~ ERROR use of collaterally moved
+    //[ast]~| value used here after move
 }
 
 fn move_after_borrow_nested() {
     let a: Box<_> = box D { x: box A { x: box 0, y: 1 }, y: box 2 };
     let _x = &a.x.x;
-    //~^ borrow of `a.x.x` occurs here
+    //[ast]~^ borrow of `a.x.x` occurs here
     let _y = a.y;
-    //~^ ERROR cannot move
-    //~| move out of
+    //[ast]~^ ERROR cannot move
+    //[ast]~| move out of
     use_imm(_x);
 }
 fn copy_after_mut_borrow_nested() {
     let mut a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 };
     let _x = &mut a.x.x;
-    let _y = a.y; //~ ERROR cannot use
+    let _y = a.y; //[ast]~ ERROR cannot use
     use_mut(_x);
 }
 fn move_after_mut_borrow_nested() {
     let mut a: Box<_> = box D { x: box A { x: box 0, y: 1 }, y: box 2 };
     let _x = &mut a.x.x;
     let _y = a.y;
-    //~^ ERROR cannot move
-    //~| move out of
+    //[ast]~^ ERROR cannot move
+    //[ast]~| move out of
     use_mut(_x);
 }
 fn borrow_after_mut_borrow_nested() {
     let mut a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 };
     let _x = &mut a.x.x;
-    //~^ mutable borrow occurs here
-    let _y = &a.y; //~ ERROR cannot borrow
-    //~^ immutable borrow occurs here
+    //[ast]~^ mutable borrow occurs here
+    let _y = &a.y; //[ast]~ ERROR cannot borrow
+    //[ast]~^ immutable borrow occurs here
     use_mut(_x);
 }
 fn mut_borrow_after_borrow_nested() {
     let mut a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 };
     let _x = &a.x.x;
-    //~^ immutable borrow occurs here
-    let _y = &mut a.y; //~ ERROR cannot borrow
-    //~^ mutable borrow occurs here
+    //[ast]~^ immutable borrow occurs here
+    let _y = &mut a.y; //[ast]~ ERROR cannot borrow
+    //[ast]~^ mutable borrow occurs here
     use_imm(_x);
 }
 #[rustc_error]
-fn main() {
+fn main() { //[mir]~ ERROR compilation successful
     copy_after_move();
     move_after_move();
     borrow_after_move();