]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/option-content-move2.stderr
Override rustc version in ui and mir-opt tests to get stable hashes
[rust.git] / src / test / ui / suggestions / option-content-move2.stderr
1 error[E0507]: cannot move out of `var`, a captured variable in an `FnMut` closure
2   --> $DIR/option-content-move2.rs:9:9
3    |
4 LL |       let mut var = None;
5    |           ------- captured outer variable
6 LL |       func(|| {
7    |  __________-
8 LL | |         // Shouldn't suggest `move ||.as_ref()` here
9 LL | |         move || {
10    | |         ^^^^^^^ move out of `var` occurs here
11 LL | |
12 LL | |             var = Some(NotCopyable);
13    | |             ---
14    | |             |
15    | |             move occurs because `var` has type `Option<NotCopyable>`, which does not implement the `Copy` trait
16    | |             move occurs due to use in closure
17 LL | |         }
18 LL | |     });
19    | |_____- captured by this `FnMut` closure
20
21 error: aborting due to previous error
22
23 For more information about this error, try `rustc --explain E0507`.