Warning about disabled lints that don't need disabling?

If Rust code contains a directive to disable a lint, could rustc produce a warning if it doesn’t actually need to emit that lint, suggesting the removal of the disabling directive? (In the same spirit as “unused import” warnings.)

Some code may disable certain lints, but if the code later gets improved to not need that, I’d like to have a warning telling me that I can stop disabling those lints.

15 Likes

And you would be able to turn that warning off using #![allow(unused_lints)]. But how do you turn that one off?

4 Likes

Related issue: https://github.com/rust-lang/rust/issues/39958

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.