error: mutable key type --> tests/ui/mut_key.rs:31:32 | LL | fn should_not_take_this_arg(m: &mut HashMap, _n: usize) -> HashSet { | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ... because it contains `Key`, which has interior mutability = note: ... because it contains `AtomicUsize`, which has interior mutability = note: ... because it contains `UnsafeCell`, which has interior mutability = note: `-D clippy::mutable-key-type` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::mutable_key_type)]` error: mutable key type --> tests/ui/mut_key.rs:31:72 | LL | fn should_not_take_this_arg(m: &mut HashMap, _n: usize) -> HashSet { | ^^^^^^^^^^^^ | = note: ... because it contains `Key`, which has interior mutability = note: ... because it contains `AtomicUsize`, which has interior mutability = note: ... because it contains `UnsafeCell`, which has interior mutability error: mutable key type --> tests/ui/mut_key.rs:35:5 | LL | let _other: HashMap = HashMap::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ... because it contains `Key`, which has interior mutability = note: ... because it contains `AtomicUsize`, which has interior mutability = note: ... because it contains `UnsafeCell`, which has interior mutability error: mutable key type --> tests/ui/mut_key.rs:64:22 | LL | fn tuples_bad(_m: &mut HashMap<(Key, U), bool>) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ... because it contains `(Key, U)`, which has interior mutability = note: ... because it contains `Key`, which has interior mutability = note: ... because it contains `AtomicUsize`, which has interior mutability = note: ... because it contains `UnsafeCell`, which has interior mutability error: mutable key type --> tests/ui/mut_key.rs:77:5 | LL | let _map = HashMap::, usize>::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ... because it contains `Cell`, which has interior mutability = note: ... because it contains `UnsafeCell`, which has interior mutability error: mutable key type --> tests/ui/mut_key.rs:80:5 | LL | let _map = HashMap::<&mut Cell, usize>::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ... because it contains `&mut Cell`, which has interior mutability = note: ... because it contains `Cell`, which has interior mutability = note: ... because it contains `UnsafeCell`, which has interior mutability error: mutable key type --> tests/ui/mut_key.rs:84:5 | LL | let _map = HashMap::>, usize>::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ... because it contains `Vec>`, which has interior mutability = note: ... because it contains `Cell`, which has interior mutability = note: ... because it contains `UnsafeCell`, which has interior mutability error: mutable key type --> tests/ui/mut_key.rs:87:5 | LL | let _map = HashMap::, ()>, usize>::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ... because it contains `BTreeMap, ()>`, which has interior mutability = note: ... because it contains `Cell`, which has interior mutability = note: ... because it contains `UnsafeCell`, which has interior mutability error: mutable key type --> tests/ui/mut_key.rs:90:5 | LL | let _map = HashMap::>, usize>::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ... because it contains `BTreeMap<(), Cell>`, which has interior mutability = note: ... because it contains `Cell`, which has interior mutability = note: ... because it contains `UnsafeCell`, which has interior mutability error: mutable key type --> tests/ui/mut_key.rs:93:5 | LL | let _map = HashMap::>, usize>::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ... because it contains `BTreeSet>`, which has interior mutability = note: ... because it contains `Cell`, which has interior mutability = note: ... because it contains `UnsafeCell`, which has interior mutability error: mutable key type --> tests/ui/mut_key.rs:96:5 | LL | let _map = HashMap::>, usize>::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ... because it contains `Option>`, which has interior mutability = note: ... because it contains `Cell`, which has interior mutability = note: ... because it contains `UnsafeCell`, which has interior mutability error: mutable key type --> tests/ui/mut_key.rs:99:5 | LL | let _map = HashMap::>>, usize>::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ... because it contains `Option>>`, which has interior mutability = note: ... because it contains `Vec>`, which has interior mutability = note: ... because it contains `Cell`, which has interior mutability = note: ... because it contains `UnsafeCell`, which has interior mutability error: mutable key type --> tests/ui/mut_key.rs:103:5 | LL | let _map = HashMap::>, usize>::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ... because it contains `Box>`, which has interior mutability = note: ... because it contains `Cell`, which has interior mutability = note: ... because it contains `UnsafeCell`, which has interior mutability error: mutable key type --> tests/ui/mut_key.rs:106:5 | LL | let _map = HashMap::>, usize>::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ... because it contains `Rc>`, which has interior mutability = note: ... because it contains `Cell`, which has interior mutability = note: ... because it contains `UnsafeCell`, which has interior mutability error: mutable key type --> tests/ui/mut_key.rs:109:5 | LL | let _map = HashMap::>, usize>::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: ... because it contains `Arc>`, which has interior mutability = note: ... because it contains `Cell`, which has interior mutability = note: ... because it contains `UnsafeCell`, which has interior mutability error: aborting due to 15 previous errors