Idea: Allow #[allow(clippy::mutable_key_type)]
on type definitions
#13865
Labels
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
Description
Problem
I am getting false positives from
mutable_key_type
on a type I own. (Illustrative Playground.) The current options to silence them are:Label each site at which it is used, with
#[allow(clippy::mutable_key_type)]
.Add the type to
clippy.toml
or other config, under the keyignore-interior-mutability
.My solution so far has been to do the latter, and write a comment on the key type's definition, explaining the situation and referring to the clippy config file.
Idea
What if type definitions could also be annotated with
#[allow(clippy::mutable_key_type)]
?It feels a lot more intuitive than the current options, and would simultaneously
allow
as a lint reason, instead of an impromptu comment.Version
Additional Labels
@rustbot label +C-enhancement
The text was updated successfully, but these errors were encountered: