You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clippy seems to give a false positive when a hashmap has a key that consists of a tuple of a struct and a generic:
structSomeStruct<T:Hash + Eq>{map:HashMap<(T,U),()>,}impl<T:Hash + Eq>SomeStruct<T>{fntest(&mutself){let _mut_map_ref = &mutself.map;// error: mutable key type// = note: `#[deny(clippy::mutable_key_type)]` on by default// = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type}}
Changing the key to be either T or U (not a tuple) removes the error:
// This is finestructSomeStruct<T:Hash + Eq>{map:HashMap<T,()>,}// This is also finestructSomeStruct<T:Hash + Eq>{map:HashMap<U,()>,pd:PhantomData<T>,}
Clippy seems to give a false positive when a hashmap has a key that consists of a tuple of a struct and a generic:
Changing the key to be either
T
orU
(not a tuple) removes the error:Playground link: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=07ec1df6c1010ae39a5adf4017f0dca3
This might be related to #5020
The text was updated successfully, but these errors were encountered: