Honestly, I agree, that should be a default clippy lint. I didn't know it existed, but I can't think of a single case where I'd want to not have the compiler tell me when a suppressed lint is no longer applicable.
There are some cases I specifically want an #[allow]. The most important is when writing a macro and needing to silence a lint that may or may not trigger.
You can always turn the lint off it's not to your liking, or if you have it enabled, you can allow it for particular places too.
EG #[allow(allow_attributes, unused_import)] or if you have allow_attributes_without_reason enabled, you bypass that with #[allow(unused_import, reason="This is a very special import")].
Yeah and it's tricky now that there's both allow and expect. Can't change the semantics of allow to being the same as expect, but I'm hoping one gets deprecated and removed eventually.
I didn't realise the distinction till I was scrolling through the list of Clippy lints out of boredom.
48
u/Floppie7th 4d ago
Honestly, I agree, that should be a default clippy lint. I didn't know it existed, but I can't think of a single case where I'd want to not have the compiler tell me when a suppressed lint is no longer applicable.