Skip to content

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

Closed
@Thiez

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.

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