-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
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))
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.