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.


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


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