]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-move-out-of-vec-tail.nll.stderr
Update output for borrowck=migrate compare mode.
[rust.git] / src / test / ui / borrowck / borrowck-move-out-of-vec-tail.nll.stderr
1 error[E0508]: cannot move out of type `[Foo]`, a non-copy slice
2   --> $DIR/borrowck-move-out-of-vec-tail.rs:29:19
3    |
4 LL |             match tail {
5    |                   ^^^^ cannot move out of here
6 LL |                 &[Foo { string: a },
7    |                                 - data moved here
8 ...
9 LL |                   Foo { string: b }] => {
10    |                                 - ...and here
11    |
12 note: move occurs because these variables have types that don't implement the `Copy` trait
13   --> $DIR/borrowck-move-out-of-vec-tail.rs:30:33
14    |
15 LL |                 &[Foo { string: a },
16    |                                 ^
17 ...
18 LL |                   Foo { string: b }] => {
19    |                                 ^
20 help: consider removing the `&`
21    |
22 LL |                 [Foo { string: a },
23 LL |                 //~^ ERROR cannot move out of type `[Foo]`
24 LL |                 //~| cannot move out
25 LL |                 //~| to prevent move
26 LL |                   Foo { string: b }] => {
27    |
28
29 error[E0507]: cannot move out of `tail[..].string` which is behind a `&` reference
30   --> $DIR/borrowck-move-out-of-vec-tail.rs:30:33
31    |
32 LL |         [_, ref tail..] => {
33    |             -------- help: consider changing this to be a mutable reference: `ref mut tail`
34 LL |             match tail {
35 LL |                 &[Foo { string: a },
36    |                                 ^
37    |                                 |
38    |                                 cannot move out of `tail[..].string` which is behind a `&` reference
39    |                                 `tail` is a `&` reference, so the data it refers to cannot be moved
40
41 error[E0507]: cannot move out of `tail[..].string` which is behind a `&` reference
42   --> $DIR/borrowck-move-out-of-vec-tail.rs:34:33
43    |
44 LL |         [_, ref tail..] => {
45    |             -------- help: consider changing this to be a mutable reference: `ref mut tail`
46 ...
47 LL |                   Foo { string: b }] => {
48    |                                 ^
49    |                                 |
50    |                                 cannot move out of `tail[..].string` which is behind a `&` reference
51    |                                 `tail` is a `&` reference, so the data it refers to cannot be moved
52
53 error: aborting due to 3 previous errors
54
55 Some errors occurred: E0507, E0508.
56 For more information about an error, try `rustc --explain E0507`.