]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-87456-point-to-closure.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / issue-87456-point-to-closure.stderr
1 error[E0507]: cannot move out of `val`, a captured variable in an `FnMut` closure
2   --> $DIR/issue-87456-point-to-closure.rs:10:28
3    |
4 LL |     let val = String::new();
5    |         --- captured outer variable
6 LL |
7 LL |     take_mut(|| {
8    |              -- captured by this `FnMut` closure
9 LL |
10 LL |         let _foo: String = val;
11    |                            ^^^ move occurs because `val` has type `String`, which does not implement the `Copy` trait
12    |
13 help: consider borrowing here
14    |
15 LL |         let _foo: String = &val;
16    |                            +
17
18 error: aborting due to previous error
19
20 For more information about this error, try `rustc --explain E0507`.