]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/not-copy-closure.nll.stderr
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / not-copy-closure.nll.stderr
index b278df5e4b4cff86f97a70118f7bd408a93c5038..1a65bcf4473172300f6cb0cd572874b42f209005 100644 (file)
@@ -1,10 +1,16 @@
 error[E0382]: use of moved value: `hello`
-  --> $DIR/not-copy-closure.rs:20:13
+  --> $DIR/not-copy-closure.rs:10:13
    |
 LL |     let b = hello;
    |             ----- value moved here
 LL |     let c = hello; //~ ERROR use of moved value: `hello` [E0382]
    |             ^^^^^ value used here after move
+   |
+note: closure cannot be moved more than once as it is not `Copy` due to moving the variable `a` out of its environment
+  --> $DIR/not-copy-closure.rs:6:9
+   |
+LL |         a += 1;
+   |         ^
 
 error: aborting due to previous error