23 lines
806 B
Plaintext
23 lines
806 B
Plaintext
error[E0373]: closure may outlive the current function, but it borrows `v`, which is owned by the current function
|
|
--> $DIR/issue-4335.rs:6:17
|
|
|
|
|
LL | id(Box::new(|| *v))
|
|
| ^^ - `v` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `v`
|
|
help: to force the closure to take ownership of `v` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | id(Box::new(move || *v))
|
|
| ^^^^^^^
|
|
|
|
error[E0507]: cannot move out of borrowed content
|
|
--> $DIR/issue-4335.rs:6:20
|
|
|
|
|
LL | id(Box::new(|| *v))
|
|
| ^^ cannot move out of borrowed content
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
Some errors occurred: E0373, E0507.
|
|
For more information about an error, try `rustc --explain E0373`.
|