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