rust-lang / rust-clippy

A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/
https://rust-lang.github.io/rust-clippy/
Other
11.04k stars 1.48k forks source link

require macro and generic testcases for new lints and lint updates #3982

Open gnzlbg opened 5 years ago

gnzlbg commented 5 years ago

Given how many lints are currently broken for code inside macros, and how many lints have been so over the years, I think it should be a requirement for new lints to at least contain one test that tries to break the lint when used inside a macro. I believe most issues could have been caught by just remembering that macros exists when testing a new lint.

gnzlbg commented 5 years ago

I also believe that the same applies to generics.

Also, I am not suggesting that new lints or updated lints should "work" on macros or generics. The only thing that I am suggesting is that if they cannot work in these contexts, they should try to detect these and bail out silently instead of displaying false positives.