Skip to content

lint suggestion: needless_lifetimes in impl<'a> #12424

@thetayloredman

Description

@thetayloredman

What it does

needless_lifetimes currently could support suggesting lifetime elison in impl<'a> T<'a> or impl<'a> Trait for T<'a> signatures.

Advantage

Adds extra verbosity which is not necessary. If we elide lifetimes everywhere else, why don't we suggest it here?

Drawbacks

Unsure if there is any.

Example

impl<'a> MyType<'a> {
    // method definitions that don't reference 'a
}

Could be written as:

impl MyType<'_> {
    // method definitions that don't reference 'a
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions