Sometimes you want to suppress a clippy warning for the time being and you let clippy ignore a specific rule for a specific code block by adding lines like the following:
#[allow(dead_code)]
But as the project continues, it can actually happen that you remove the problem, without actually removing the allowing of the clippy lint. So is there a way to check for allowed clippy warnings that are actually not being used anymore? So in this example I'd like to be informed when I #[allow(dead_code)] but there is actually no dead code to be found in the given code block.
The unstable feature (currently only usable using the nightly Rust compiler)
lint_reasonsincludes the ability to useexpect(instead ofallow(, which allows the lint but warns if the lint is not detected.Output:
There is no current schedule for this to make it to stable but at least people want to see it and there's an implementation.