Update the expected error output to reflect changes in this PR.

This commit is contained in:
Felix S. Klock II 2018-05-31 12:58:34 +02:00
parent 9b24595226
commit e5b378b18d
3 changed files with 63 additions and 38 deletions

View File

@ -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`.

View File

@ -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`.

View File

@ -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
| ^^^^^^