Skip to content

E0373 needs to be updated to new format #35337

Closed
@sophiajt

Description

@sophiajt

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

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsE-easyCall 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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions