]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/issue-87456-point-to-closure.stderr
Rollup merge of #88090 - nbdd0121:inference, r=nikomatsakis
[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    |  ______________-
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 LL | |
16 LL | |
17 LL | |     })
18    | |_____- captured by this `FnMut` closure
19
20 error: aborting due to previous error
21
22 For more information about this error, try `rustc --explain E0507`.