]> git.lizzy.rs Git - rust.git/blobdiff - 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
index f3430ba4e06c9038310a8f087594447e8b89dbce..dea42c53992b19bdabae96a6dd490d9f88c06a41 100644 (file)
@@ -26,6 +26,31 @@ LL |                 //~| to prevent move
 LL |                   Foo { string: b }] => {
    |
 
-error: aborting due to previous error
+error[E0507]: cannot move out of `tail[..].string` which is behind a `&` reference
+  --> $DIR/borrowck-move-out-of-vec-tail.rs:30:33
+   |
+LL |         [_, ref tail..] => {
+   |             -------- help: consider changing this to be a mutable reference: `ref mut tail`
+LL |             match tail {
+LL |                 &[Foo { string: a },
+   |                                 ^
+   |                                 |
+   |                                 cannot move out of `tail[..].string` which is behind a `&` reference
+   |                                 `tail` is a `&` reference, so the data it refers to cannot be moved
+
+error[E0507]: cannot move out of `tail[..].string` which is behind a `&` reference
+  --> $DIR/borrowck-move-out-of-vec-tail.rs:34:33
+   |
+LL |         [_, ref tail..] => {
+   |             -------- help: consider changing this to be a mutable reference: `ref mut tail`
+...
+LL |                   Foo { string: b }] => {
+   |                                 ^
+   |                                 |
+   |                                 cannot move out of `tail[..].string` which is behind a `&` reference
+   |                                 `tail` is a `&` reference, so the data it refers to cannot be moved
+
+error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0508`.
+Some errors occurred: E0507, E0508.
+For more information about an error, try `rustc --explain E0507`.