-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
emit unused_attributes lint for silly attributes #55112
Copy link
Copy link
Closed
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
We already have an
UnusedAttributeslate 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_attributesif a level attr only has a reason #94580