about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2018-05-31 12:58:34 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2018-06-06 22:42:27 +0200
commite5b378b18df428e296243a82e4a2c5856ef0cb75 (patch)
tree4743f72f00d4aa4e376afc4da519cecb8ba4d148
parent9b24595226f3290e09aada4d3d370331d71e6241 (diff)
downloadrust-e5b378b18df428e296243a82e4a2c5856ef0cb75.tar.gz
rust-e5b378b18df428e296243a82e4a2c5856ef0cb75.zip
Update the expected error output to reflect changes in this PR.
-rw-r--r--src/test/ui/borrowck/borrowck-move-out-of-vec-tail.nll.stderr10
-rw-r--r--src/test/ui/borrowck/borrowck-vec-pattern-nesting.nll.stderr77
-rw-r--r--src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr14
3 files changed, 63 insertions, 38 deletions
diff --git a/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.nll.stderr b/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.nll.stderr
index a430c97158a..96b376ea7ae 100644
--- a/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.nll.stderr
+++ b/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.nll.stderr
@@ -1,15 +1,15 @@
-error[E0507]: cannot move out of borrowed content
+error[E0508]: cannot move out of type `[Foo]`, a non-copy slice
   --> $DIR/borrowck-move-out-of-vec-tail.rs:30:33
    |
 LL |                 &[Foo { string: a },
-   |                                 ^ cannot move out of borrowed content
+   |                                 ^ cannot move out of here
 
-error[E0507]: cannot move out of borrowed content
+error[E0508]: cannot move out of type `[Foo]`, a non-copy slice
   --> $DIR/borrowck-move-out-of-vec-tail.rs:34:33
    |
 LL |                   Foo { string: b }] => {
-   |                                 ^ cannot move out of borrowed content
+   |                                 ^ cannot move out of here
 
 error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0507`.
+For more information about this error, try `rustc --explain E0508`.
diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-nesting.nll.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.nll.stderr
index d5a66a6c706..6d28a37463b 100644
--- a/src/test/ui/borrowck/borrowck-vec-pattern-nesting.nll.stderr
+++ b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.nll.stderr
@@ -1,51 +1,76 @@
-error[E0507]: cannot move out of borrowed content
-  --> $DIR/borrowck-vec-pattern-nesting.rs:42:15
+error[E0506]: cannot assign to `vec[..]` because it is borrowed
+  --> $DIR/borrowck-vec-pattern-nesting.rs:20:13
+   |
+LL |         [box ref _a, _, _] => {
+   |              ------ borrow of `vec[..]` occurs here
+LL |         //~^ borrow of `vec[..]` occurs here
+LL |             vec[0] = box 4; //~ ERROR cannot assign
+   |             ^^^^^^ assignment to borrowed `vec[..]` occurs here
+LL |             //~^ assignment to borrowed `vec[..]` occurs here
+LL |             _a.use_ref();
+   |             -- borrow later used here
+
+error[E0506]: cannot assign to `vec[..]` because it is borrowed
+  --> $DIR/borrowck-vec-pattern-nesting.rs:33:13
+   |
+LL |         &mut [ref _b..] => {
+   |               ------ borrow of `vec[..]` occurs here
+LL |         //~^ borrow of `vec[..]` occurs here
+LL |             vec[0] = box 4; //~ ERROR cannot assign
+   |             ^^^^^^ assignment to borrowed `vec[..]` occurs here
+LL |             //~^ assignment to borrowed `vec[..]` occurs here
+LL |             _b.use_ref();
+   |             -- borrow later used here
+
+error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
+  --> $DIR/borrowck-vec-pattern-nesting.rs:44:15
    |
 LL |         &mut [_a, //~ ERROR cannot move out
-   |               ^^ cannot move out of borrowed content
+   |               ^^ cannot move out of here
 
-error[E0507]: cannot move out of borrowed content
-  --> $DIR/borrowck-vec-pattern-nesting.rs:55:13
+error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
+  --> $DIR/borrowck-vec-pattern-nesting.rs:57:13
    |
 LL |     let a = vec[0]; //~ ERROR cannot move out
-   |             ^^^^^^ cannot move out of borrowed content
+   |             ^^^^^^ cannot move out of here
 
-error[E0507]: cannot move out of borrowed content
-  --> $DIR/borrowck-vec-pattern-nesting.rs:65:10
+error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
+  --> $DIR/borrowck-vec-pattern-nesting.rs:67:10
    |
 LL |          _b] => {}
-   |          ^^ cannot move out of borrowed content
+   |          ^^ cannot move out of here
 
-error[E0507]: cannot move out of borrowed content
-  --> $DIR/borrowck-vec-pattern-nesting.rs:68:13
+error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
+  --> $DIR/borrowck-vec-pattern-nesting.rs:70:13
    |
 LL |     let a = vec[0]; //~ ERROR cannot move out
-   |             ^^^^^^ cannot move out of borrowed content
+   |             ^^^^^^ cannot move out of here
 
-error[E0507]: cannot move out of borrowed content
-  --> $DIR/borrowck-vec-pattern-nesting.rs:76:15
+error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
+  --> $DIR/borrowck-vec-pattern-nesting.rs:78:15
    |
 LL |         &mut [_a, _b, _c] => {}  //~ ERROR cannot move out
-   |               ^^ cannot move out of borrowed content
+   |               ^^ cannot move out of here
 
-error[E0507]: cannot move out of borrowed content
-  --> $DIR/borrowck-vec-pattern-nesting.rs:76:19
+error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
+  --> $DIR/borrowck-vec-pattern-nesting.rs:78:19
    |
 LL |         &mut [_a, _b, _c] => {}  //~ ERROR cannot move out
-   |                   ^^ cannot move out of borrowed content
+   |                   ^^ cannot move out of here
 
-error[E0507]: cannot move out of borrowed content
-  --> $DIR/borrowck-vec-pattern-nesting.rs:76:23
+error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
+  --> $DIR/borrowck-vec-pattern-nesting.rs:78:23
    |
 LL |         &mut [_a, _b, _c] => {}  //~ ERROR cannot move out
-   |                       ^^ cannot move out of borrowed content
+   |                       ^^ cannot move out of here
 
-error[E0507]: cannot move out of borrowed content
-  --> $DIR/borrowck-vec-pattern-nesting.rs:80:13
+error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
+  --> $DIR/borrowck-vec-pattern-nesting.rs:82:13
    |
 LL |     let a = vec[0]; //~ ERROR cannot move out
-   |             ^^^^^^ cannot move out of borrowed content
+   |             ^^^^^^ cannot move out of here
 
-error: aborting due to 8 previous errors
+error: aborting due to 10 previous errors
 
-For more information about this error, try `rustc --explain E0507`.
+Some errors occurred: E0506, E0508.
+For more information about an error, try `rustc --explain E0506`.
diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr
index 6673549e239..a03e1eab7ad 100644
--- a/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr
+++ b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr
@@ -8,7 +8,7 @@ LL |             vec[0] = box 4; //~ ERROR cannot assign
    |             ^^^^^^^^^^^^^^ assignment to borrowed `vec[..]` occurs here
 
 error[E0506]: cannot assign to `vec[..]` because it is borrowed
-  --> $DIR/borrowck-vec-pattern-nesting.rs:32:13
+  --> $DIR/borrowck-vec-pattern-nesting.rs:33:13
    |
 LL |         &mut [ref _b..] => {
    |               ------ borrow of `vec[..]` occurs here
@@ -17,7 +17,7 @@ LL |             vec[0] = box 4; //~ ERROR cannot assign
    |             ^^^^^^^^^^^^^^ assignment to borrowed `vec[..]` occurs here
 
 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
-  --> $DIR/borrowck-vec-pattern-nesting.rs:42:14
+  --> $DIR/borrowck-vec-pattern-nesting.rs:44:14
    |
 LL |           &mut [_a, //~ ERROR cannot move out
    |                ^-- hint: to prevent move, use `ref _a` or `ref mut _a`
@@ -30,7 +30,7 @@ LL | |         ] => {
    | |_________^ cannot move out of here
 
 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
-  --> $DIR/borrowck-vec-pattern-nesting.rs:55:13
+  --> $DIR/borrowck-vec-pattern-nesting.rs:57:13
    |
 LL |     let a = vec[0]; //~ ERROR cannot move out
    |             ^^^^^^
@@ -39,7 +39,7 @@ LL |     let a = vec[0]; //~ ERROR cannot move out
    |             help: consider using a reference instead: `&vec[0]`
 
 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
-  --> $DIR/borrowck-vec-pattern-nesting.rs:63:14
+  --> $DIR/borrowck-vec-pattern-nesting.rs:65:14
    |
 LL |           &mut [ //~ ERROR cannot move out
    |  ______________^
@@ -50,7 +50,7 @@ LL | |          _b] => {}
    |            hint: to prevent move, use `ref _b` or `ref mut _b`
 
 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
-  --> $DIR/borrowck-vec-pattern-nesting.rs:68:13
+  --> $DIR/borrowck-vec-pattern-nesting.rs:70:13
    |
 LL |     let a = vec[0]; //~ ERROR cannot move out
    |             ^^^^^^
@@ -59,7 +59,7 @@ LL |     let a = vec[0]; //~ ERROR cannot move out
    |             help: consider using a reference instead: `&vec[0]`
 
 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
-  --> $DIR/borrowck-vec-pattern-nesting.rs:76:14
+  --> $DIR/borrowck-vec-pattern-nesting.rs:78:14
    |
 LL |         &mut [_a, _b, _c] => {}  //~ ERROR cannot move out
    |              ^--^^--^^--^
@@ -70,7 +70,7 @@ LL |         &mut [_a, _b, _c] => {}  //~ ERROR cannot move out
    |              cannot move out of here
 
 error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
-  --> $DIR/borrowck-vec-pattern-nesting.rs:80:13
+  --> $DIR/borrowck-vec-pattern-nesting.rs:82:13
    |
 LL |     let a = vec[0]; //~ ERROR cannot move out
    |             ^^^^^^