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

Split needless_lifetime '_ suggestions into elidable_lifetime_names #13960

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Alexendoo
Copy link
Member

@Alexendoo Alexendoo commented Jan 7, 2025

Fixes #13514

changelog: Split [needless_lifetime] suggestions that use '_ into a new lint [elidable_lifetime_names]

@rustbot
Copy link
Collaborator

rustbot commented Jan 7, 2025

r? @xFrednet

rustbot has assigned @xFrednet.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 7, 2025
Copy link
Contributor

@samueltardieu samueltardieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this lint splitting, I'm just not sure about the category to use for the new lint.

/// ```
#[clippy::version = "1.84.0"]
pub ELIDABLE_LIFETIME_NAMES,
pedantic,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR does two things at once: it not only splits the lint, but also moves part of it from complexity to pedantic. Since people would be able to silence the elidable_lifetime_names, shouldn't it stay into complexity?

My rationale is that an unused variable will get flagged if it doesn't start with _, why shouldn't we continue to do the same with unused lifetimes?

@@ -1,4 +1,4 @@
#![deny(clippy::needless_lifetimes)]
#![deny(clippy::elidable_lifetime_names)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the files be renamed as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider splitting needless_lifetimes into cases that do and do not require '_
4 participants