Skip to content

emit unused_attributes lint for silly attributes #55112

Description

@zackmdavis

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:

Activity

  1. added
    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
    A-attributesArea: Attributes (`#[…]`, `#![…]`)
    on Oct 16, 2018
  2. varkor commented on Oct 16, 2018

    @varkor
    Contributor

    I think "#[must_use] on functions with unit or uninhabited return type" should be a Clippy lint rather than a compiler lint.

  3. Centril commented on Oct 17, 2018

    @Centril
    Contributor

    I've stricken #[must_use] per @varkor's note.

  4. added 2 commits that reference this issue on Jun 22, 2019
  5. added
    C-enhancementCategory: 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.
    on Apr 12, 2020
  6. ehuss commented on Sep 6, 2021

    @ehuss
    Contributor

    Posted #88681 which adds some checks for empty attributes like #[allow()].

  7. added a commit that references this issue on Nov 19, 2021
    9ac19a5
  8. added a commit that references this issue on Mar 8, 2022
  9. added
    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
    and removed
    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
    on Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: 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.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions