Repository navigation
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.
Description
Activity
- addedA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)
on 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.
Reacted by scottmcm and Mazdak FarrokhzadI've stricken
#[must_use]per @varkor's note.- addedC-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.
on Apr 12, 2020 Posted #88681 which adds some checks for empty attributes like
#[allow()].- added a commit that references this issue
on Nov 19, 2021 - addedA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.and removedA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.
on Dec 21, 2024
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.
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