Closed behnam closed 6 years ago
Classifying each lint can be difficult and error-prone, because there's always the possibility that a lint is buggy and doesn't catch all the cases it's supposed to catch. For example, consider the unused_mut
lint. How would you classify this lint? One could reasonably classify it as "cannot suddenly get triggered by a compiler update", because updates to the language shouldn't cause a mutable variable to suddenly become not mutated, right?
Now, if I told you that in Rust 1.21, there was a fix to the lint that made it report mut
variables that were &mut
references but weren't mutated themselves, does your classification still hold? (I had a case in my own code where I got an unused_mut
lint warning for this reason after updating the compiler.)
Yeah, agreed that no lint warning can promised to not be triggered in some future. I guess we can close this issue now. Please feel free to re-open if there's any way to apply a classification.
Looks like we have to main source for lint attributes and warnings/errors:
rustc -W help
In neither of these resources there's coverage for which of this these lint rules can get triggered depending on a compiler version, and which ones don't.
For example,
unsafe-code
cannot suddenly get triggered by a compiler update.But,
missing-docs
, on the other hand, can get triggered whenever compiler supports docs for new language items.I think not distinguishing these two types of lints is a common cause for denying/forbidding risky lints on the code.
Maybe there could be a Lint Group for these? Or some other way to tell them apart?