1 error[E0507]: cannot move out of captured variable in an `FnMut` closure
2 --> $DIR/issue-4335.rs:16:20
4 LL | id(Box::new(|| *v))
5 | ^^ cannot move out of captured variable in an `FnMut` closure
7 error[E0597]: `v` does not live long enough
8 --> $DIR/issue-4335.rs:16:21
10 LL | id(Box::new(|| *v))
11 | -- ^ borrowed value does not live long enough
16 | - `v` dropped here while still borrowed
18 note: borrowed value must be valid for the lifetime 'r as defined on the function body at 15:6...
19 --> $DIR/issue-4335.rs:15:6
21 LL | fn f<'r, T>(v: &'r T) -> Box<FnMut() -> T + 'r> {
24 error: aborting due to 2 previous errors
26 Some errors occurred: E0507, E0597.
27 For more information about an error, try `rustc --explain E0507`.