Skip to content

Commit

Permalink
Update the expected error output to reflect changes in this PR.
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkfelix committed Jun 6, 2018
1 parent 9b24595 commit e5b378b
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 38 deletions.
10 changes: 5 additions & 5 deletions src/test/ui/borrowck/borrowck-move-out-of-vec-tail.nll.stderr
Original file line number Diff line number Diff line change
@@ -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`.
77 changes: 51 additions & 26 deletions src/test/ui/borrowck/borrowck-vec-pattern-nesting.nll.stderr
Original file line number Diff line number Diff line change
@@ -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`.
14 changes: 7 additions & 7 deletions src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`
Expand All @@ -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
| ^^^^^^
Expand All @@ -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
| ______________^
Expand All @@ -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
| ^^^^^^
Expand All @@ -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
| ^--^^--^^--^
Expand All @@ -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
| ^^^^^^
Expand Down

0 comments on commit e5b378b

Please sign in to comment.