Skip to content

Add a lint pass that warns about unknown annotations. #6884

Closed

Description

@Thiez

The compiler does not warn about annotations it does not recognize. I recently noticed some code annotated with several instances of #[incline]. Those annotations had been sitting there unnoticed for over a year. It would be nice if the compiler would emit a warning.

As discussed on IRC, one way this might be implemented would be marking annotations as 'used' when they are used, and then do a pass very late in compilation that checks for unused annotations. This would free the lint pass from having a list of valid annotations and their semantics.

Activity

  1. catamorphism commented on Jun 1, 2013

    @catamorphism
    Contributor

    +1

  2. bblum commented on Jul 29, 2013

    @bblum
    Contributor

    Related #2976. Nominating feature-complete.

  3. catamorphism commented on Aug 29, 2013

    @catamorphism
    Contributor

    Related to #7318

  4. catamorphism commented on Aug 29, 2013

    @catamorphism
    Contributor

    Just a bug, more of a developer issue

  5. pnkfelix commented on Aug 29, 2013

    @pnkfelix
    Contributor

    (I think we agreed informally that such a lint pass might be useful to some, but that it would be turned off (allow) by default; I think this aligns with the discussion on #7318.)

  6. klutzy commented on Dec 7, 2013

    @klutzy
    Contributor

    This is fixed by #10316.

  7. alexcrichton commented on Dec 7, 2013

    @alexcrichton
    Member

    hurray!

  8. added a commit that references this issue on Mar 12, 2021
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.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions