Skip to content

NLL: missing note that "borrowed value needs to live until here" (sometimes?) #51168

Closed
@pnkfelix

Description

@pnkfelix

Consider: https://github.com/rust-lang/rust/blob/master/src/test/ui/span/issue-11925.nll.stderr

Compare it to: https://github.com/rust-lang/rust/blob/master/src/test/ui/span/issue-11925.stderr

The former is missing a note that "borrowed value needs to live until here"


Oftentimes, NLL diagnostics do include a note of the form "needs to live until use here." But apparently for this case (due to closures? Or destructors? Or both?) we do not have such a use to point at.

Anyway, this represents a regression in the informativeness of our diagnostics under NLL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-NLLArea: Non-lexical lifetimes (NLL)C-enhancementCategory: An issue proposing an enhancement or a PR with one.NLL-diagnosticsWorking towards the "diagnostic parity" goalT-langRelevant to the language team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions