]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/unop-move-semantics.nll.stderr
New upstream version 1.31.0~beta.4+dfsg1
[rustc.git] / src / test / ui / unop-move-semantics.nll.stderr
index 111940aab2c322764150b4a5be8539b966a6a6ad..8112ddbe2f16e8db858080f795c9fa8daca7bcfb 100644 (file)
@@ -21,7 +21,19 @@ error[E0507]: cannot move out of borrowed content
 LL |     !*n;  //~ ERROR: cannot move out of borrowed content
    |      ^^ cannot move out of borrowed content
 
-error: aborting due to 3 previous errors
+error[E0507]: cannot move out of `*n` which is behind a `&` reference
+  --> $DIR/unop-move-semantics.rs:36:6
+   |
+LL |     let n = &y;
+   |             -- help: consider changing this to be a mutable reference: `&mut y`
+...
+LL |     !*n;  //~ ERROR: cannot move out of borrowed content
+   |      ^^
+   |      |
+   |      cannot move out of `*n` which is behind a `&` reference
+   |      `n` is a `&` reference, so the data it refers to cannot be moved
+
+error: aborting due to 4 previous errors
 
 Some errors occurred: E0382, E0507.
 For more information about an error, try `rustc --explain E0382`.