Skip to content

Quick fix to declare an unresolved lifetime #11039

Open
@matklad

Description

@matklad

With inband lifetimes going away (rust-lang/rust#44524), I believe we should just fix the ergonomics at the ide layer.

Typing fn foo(&'a str) should emit an error for unresolved 'a, and a quick fix to declare a lifetime: fn foo<'a>(&'a str).

See how NoSuchField diagnostics is treated, which has a similar flow with a fix: https://github.com/rust-analyzer/rust-analyzer/search?q=NoSuchField.

@Veykril I believe you did name resolution for lifetimes, could you add a code link for where it is happening?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsdiagnostics / error reportingC-featureCategory: feature requestE-has-instructionsIssue has some instructions and pointers to code to get startedS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions