Closed
Description
From: src/test/compile-fail/issue-4335.rs
The error E0373 needs a span_note changed to a span_label and a new span_label, updating it from:
error[E0373]: closure may outlive the current function, but it borrows `v`, which is owned by the current function
--> src/test/compile-fail/issue-4335.rs:17:17
|
17 | id(Box::new(|| *v))
| ^^
|
note: `v` is borrowed here
--> src/test/compile-fail/issue-4335.rs:17:21
|
17 | id(Box::new(|| *v))
| ^
help: to force the closure to take ownership of `v` (and any other referenced variables), use the `move` keyword, as shown:
| id(Box::new(move || *v))
To:
error[E0373]: closure may outlive the current function, but it borrows `v`, which is owned by the current function
--> src/test/compile-fail/issue-4335.rs:17:17
|
17 | id(Box::new(|| *v))
| ^^ - `v` 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, as shown:
| id(Box::new(move || *v))