]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-move-by-capture.stderr
Rollup merge of #98331 - GuillaumeGomez:rustdoc-arg-error, r=notriddle
[rust.git] / src / test / ui / borrowck / borrowck-move-by-capture.stderr
1 error[E0507]: cannot move out of `bar`, a captured variable in an `FnMut` closure
2   --> $DIR/borrowck-move-by-capture.rs:9:29
3    |
4 LL |       let bar: Box<_> = Box::new(3);
5    |           --- captured outer variable
6 LL |       let _g = to_fn_mut(|| {
7    |  ________________________-
8 LL | |         let _h = to_fn_once(move || -> isize { *bar });
9    | |                             ^^^^^^^^^^^^^^^^   ----
10    | |                             |                  |
11    | |                             |                  variable moved due to use in closure
12    | |                             |                  move occurs because `bar` has type `Box<isize>`, which does not implement the `Copy` trait
13    | |                             move out of `bar` occurs here
14 LL | |     });
15    | |_____- captured by this `FnMut` closure
16
17 error: aborting due to previous error
18
19 For more information about this error, try `rustc --explain E0507`.