]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-4335.nll.stderr
Auto merge of #52928 - Mark-Simulacrum:borrowck-cleanup, r=cramertj
[rust.git] / src / test / ui / issues / issue-4335.nll.stderr
1 error[E0507]: cannot move out of captured variable in an `FnMut` closure
2   --> $DIR/issue-4335.rs:16:20
3    |
4 LL |     id(Box::new(|| *v))
5    |                    ^^ cannot move out of captured variable in an `FnMut` closure
6
7 error[E0597]: `v` does not live long enough
8   --> $DIR/issue-4335.rs:16:21
9    |
10 LL |     id(Box::new(|| *v))
11    |                 --  ^ borrowed value does not live long enough
12    |                 |
13    |                 value captured here
14 ...
15 LL | }
16    | - `v` dropped here while still borrowed
17    |
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
20    |
21 LL | fn f<'r, T>(v: &'r T) -> Box<FnMut() -> T + 'r> {
22    |      ^^
23
24 error: aborting due to 2 previous errors
25
26 Some errors occurred: E0507, E0597.
27 For more information about an error, try `rustc --explain E0507`.