Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
Thiez opened this issue Jun 1, 2013 · 7 comments
Closed

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

Thiez opened this issue Jun 1, 2013 · 7 comments
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-lints Area: Lints (warnings about flaws in source code) such as unused_mut.

Comments

@Thiez
Copy link
Contributor

Thiez commented Jun 1, 2013

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.

@catamorphism
Copy link
Contributor

+1

@bblum
Copy link
Contributor

bblum commented Jul 29, 2013

Related #2976. Nominating feature-complete.

@catamorphism
Copy link
Contributor

Related to #7318

@catamorphism
Copy link
Contributor

Just a bug, more of a developer issue

@pnkfelix
Copy link
Member

(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.)

@klutzy
Copy link
Contributor

klutzy commented Dec 7, 2013

This is fixed by #10316.

@alexcrichton
Copy link
Member

hurray!

flip1995 pushed a commit to flip1995/rust that referenced this issue Mar 12, 2021
…earth

move lintcheck into its own crate

This pr:
* moves lintcheck out of `clippy dev` and into its own crate (`lintcheck`)  (I should have done this earlier :D)
* makes lintcheck terminate if it is not launched from the repo root (to prevent problems with wrong paths when using `cargo run` in the crate root)
* fixes json lint messages leaking the runners `$HOME` when a lint messages comes from a proc macro that originates from a crate inside the `$CARGO_CACHE`
* adds more documentation to lintchecks `README.md` and mentions lintcheck in `docs/basics.md`

changelog: none
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-lints Area: Lints (warnings about flaws in source code) such as unused_mut.
Projects
None yet
Development

No branches or pull requests

6 participants