]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-4335.stderr
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / ui / issues / issue-4335.stderr
1 error[E0373]: closure may outlive the current function, but it borrows `v`, which is owned by the current function
2   --> $DIR/issue-4335.rs:16:17
3    |
4 LL |     id(Box::new(|| *v))
5    |                 ^^  - `v` is borrowed here
6    |                 |
7    |                 may outlive borrowed value `v`
8 help: to force the closure to take ownership of `v` (and any other referenced variables), use the `move` keyword
9    |
10 LL |     id(Box::new(move || *v))
11    |                 ^^^^^^^
12
13 error[E0507]: cannot move out of borrowed content
14   --> $DIR/issue-4335.rs:16:20
15    |
16 LL |     id(Box::new(|| *v))
17    |                    ^^ cannot move out of borrowed content
18
19 error: aborting due to 2 previous errors
20
21 Some errors occurred: E0373, E0507.
22 For more information about an error, try `rustc --explain E0373`.