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

Find unused/irelevant clippy annotations #9020

Closed
SylvainDe opened this issue Jun 19, 2022 · 3 comments
Closed

Find unused/irelevant clippy annotations #9020

SylvainDe opened this issue Jun 19, 2022 · 3 comments
Labels
A-lint Area: New lints

Comments

@SylvainDe
Copy link

What it does

Here is the use case:

  1. I define an entity which causes a defect found by clippy
  2. I add a temporary annotation to to be able to run clippy and ensure that new defects are quickly found and fixed
  3. I fix the original defect and I completely forget about remove the clippy annotation

-> The clippy annotation is useless but on top of that:

  • can be confusing
  • can hide issues added to the code later on

Lint Name

useless-clippy-annotation

Category

pedantic

Advantage

Get rid of useless clippy annotations

Drawbacks

I do not know the clippy internals and thus, I have no idea if this can be easy to implement

Example

I tend to have the problem with "#[allow(clippy::missing_const_for_fn)]" which I use when prototyping and then forget to remove.

@SylvainDe SylvainDe added the A-lint Area: New lints label Jun 19, 2022
@Jarcho
Copy link
Contributor

Jarcho commented Jun 19, 2022

This is being added to rust as #[expect(...)] rust-lang/rust#54503

@SylvainDe
Copy link
Author

Great! Thanks for the quick answer :)

@SylvainDe
Copy link
Author

@SylvainDe SylvainDe closed this as not planned Won't fix, can't repro, duplicate, stale Jun 20, 2022
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

No branches or pull requests

2 participants