-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
emit unused_attributes lint for silly attributes #55112
Labels
A-attributes
Area: Attributes (`#[…]`, `#![…]`)
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
zackmdavis
added
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
A-attributes
Area: Attributes (`#[…]`, `#![…]`)
labels
Oct 16, 2018
I think "#[must_use] on functions with unit or uninhabited return type" should be a Clippy lint rather than a compiler lint. |
I've stricken |
Centril
added a commit
to Centril/rust
that referenced
this issue
Jun 22, 2019
Lint empty `#[derive()]` as unused attribute. Closes rust-lang#54651. cc rust-lang#55112 r? @petrochenkov
Centril
added a commit
to Centril/rust
that referenced
this issue
Jun 22, 2019
Lint empty `#[derive()]` as unused attribute. Closes rust-lang#54651. cc rust-lang#55112 r? @petrochenkov
JohnTitor
added
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Apr 12, 2020
6 tasks
Posted #88681 which adds some checks for empty attributes like |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 19, 2021
…chenkov Check for duplicate attributes. This adds some checks for duplicate attributes. In many cases, the duplicates were being ignored without error or warning. This adds several kinds of checks (see `AttributeDuplicates` enum). The motivation here is to issue unused warnings with similar reasoning for any unused lint, and to error for cases where there are conflicts. This also adds a check for empty attribute lists in a few attributes where this causes the attribute to be ignored. Closes rust-lang#55112.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 8, 2022
…attr, r=lcnr Emit `unused_attributes` if a level attr only has a reason Fixes a comment from `compiler/rustc_lint/src/levels.rs`. Lint level attributes that only contain a reason will also trigger the `unused_attribute` lint. The lint now also checks for the `expect` lint level. That's it, have a great rest of the day for everyone reasoning this 🙃 cc: rust-lang#55112
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-attributes
Area: Attributes (`#[…]`, `#![…]`)
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
We already have an
UnusedAttributes
late lint pass for attributes that don't get marked as having been used somewhere, but recent discussion has touched on the idea of also directly (during normal complication, not as a lint pass) issuing the lint for attributes that don't make much sense (but which we don't want to go to the length of declaring errors, e.g., for backwards-compatibility reasons). These include:#[derive()]
#[must_use]
on functions with unit or uninhabited return type#[allow()]
,#[warn()]
, &c.unused_attributes
if a level attr only has a reason #94580The text was updated successfully, but these errors were encountered: