]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/issue-87456-point-to-closure.stderr
Rollup merge of #99460 - JanBeh:PR_asref_asmut_docs, r=joshtriplett
[rust.git] / src / test / 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    |                            ^^^
12    |                            |
13    |                            move occurs because `val` has type `String`, which does not implement the `Copy` trait
14    |                            help: consider borrowing here: `&val`
15
16 error: aborting due to previous error
17
18 For more information about this error, try `rustc --explain E0507`.