Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Tracked by #93
thetayloredman opened this issue Mar 5, 2024 · 2 comments
Closed
Tracked by #93

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

thetayloredman opened this issue Mar 5, 2024 · 2 comments
Assignees
Labels
A-lint Area: New lints

Comments

@thetayloredman
Copy link

thetayloredman commented Mar 5, 2024

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
}
@thetayloredman thetayloredman added the A-lint Area: New lints label Mar 5, 2024
@m-rph
Copy link
Contributor

m-rph commented Mar 24, 2024

Given that I am in the process of cleaning up needless_lifetimes, I will pick this up.

@rustbot claim

@y21
Copy link
Member

y21 commented Oct 4, 2024

This was implemented in #13286

@y21 y21 closed this as completed Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants