]> git.lizzy.rs Git - rust.git/blob - tests/ui/not-copy-closure.stderr
Rollup merge of #107769 - compiler-errors:pointer-like, r=eholk
[rust.git] / tests / ui / not-copy-closure.stderr
1 error[E0382]: use of moved value: `hello`
2   --> $DIR/not-copy-closure.rs:10:13
3    |
4 LL |     let b = hello;
5    |             ----- value moved here
6 LL |     let c = hello;
7    |             ^^^^^ value used here after move
8    |
9 note: closure cannot be moved more than once as it is not `Copy` due to moving the variable `a` out of its environment
10   --> $DIR/not-copy-closure.rs:6:9
11    |
12 LL |         a += 1;
13    |         ^
14 help: consider mutably borrowing `hello`
15    |
16 LL |     let b = &mut hello;
17    |             ++++
18
19 error: aborting due to previous error
20
21 For more information about this error, try `rustc --explain E0382`.