mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-15 09:27:25 +00:00
114 lines
3.6 KiB
Text
114 lines
3.6 KiB
Text
error: mutable key type
|
|
--> $DIR/mut_key.rs:31:32
|
|
|
|
|
LL | fn should_not_take_this_arg(m: &mut HashMap<Key, usize>, _n: usize) -> HashSet<Key> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::mutable-key-type` implied by `-D warnings`
|
|
|
|
error: mutable key type
|
|
--> $DIR/mut_key.rs:31:72
|
|
|
|
|
LL | fn should_not_take_this_arg(m: &mut HashMap<Key, usize>, _n: usize) -> HashSet<Key> {
|
|
| ^^^^^^^^^^^^
|
|
|
|
error: mutable key type
|
|
--> $DIR/mut_key.rs:32:5
|
|
|
|
|
LL | let _other: HashMap<Key, bool> = HashMap::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: mutable key type
|
|
--> $DIR/mut_key.rs:59:22
|
|
|
|
|
LL | fn tuples_bad<U>(_m: &mut HashMap<(Key, U), bool>) {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: mutable key type
|
|
--> $DIR/mut_key.rs:71:5
|
|
|
|
|
LL | let _map = HashMap::<Cell<usize>, usize>::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: mutable key type
|
|
--> $DIR/mut_key.rs:72:5
|
|
|
|
|
LL | let _map = HashMap::<&mut Cell<usize>, usize>::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: mutable key type
|
|
--> $DIR/mut_key.rs:73:5
|
|
|
|
|
LL | let _map = HashMap::<&mut usize, usize>::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: mutable key type
|
|
--> $DIR/mut_key.rs:75:5
|
|
|
|
|
LL | let _map = HashMap::<Vec<Cell<usize>>, usize>::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: mutable key type
|
|
--> $DIR/mut_key.rs:76:5
|
|
|
|
|
LL | let _map = HashMap::<BTreeMap<Cell<usize>, ()>, usize>::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: mutable key type
|
|
--> $DIR/mut_key.rs:77:5
|
|
|
|
|
LL | let _map = HashMap::<BTreeMap<(), Cell<usize>>, usize>::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: mutable key type
|
|
--> $DIR/mut_key.rs:78:5
|
|
|
|
|
LL | let _map = HashMap::<BTreeSet<Cell<usize>>, usize>::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: mutable key type
|
|
--> $DIR/mut_key.rs:79:5
|
|
|
|
|
LL | let _map = HashMap::<Option<Cell<usize>>, usize>::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: mutable key type
|
|
--> $DIR/mut_key.rs:80:5
|
|
|
|
|
LL | let _map = HashMap::<Option<Vec<Cell<usize>>>, usize>::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: mutable key type
|
|
--> $DIR/mut_key.rs:81:5
|
|
|
|
|
LL | let _map = HashMap::<Result<&mut usize, ()>, usize>::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: mutable key type
|
|
--> $DIR/mut_key.rs:83:5
|
|
|
|
|
LL | let _map = HashMap::<Box<Cell<usize>>, usize>::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: mutable key type
|
|
--> $DIR/mut_key.rs:84:5
|
|
|
|
|
LL | let _map = HashMap::<Rc<Cell<usize>>, usize>::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: mutable key type
|
|
--> $DIR/mut_key.rs:85:5
|
|
|
|
|
LL | let _map = HashMap::<Arc<Cell<usize>>, usize>::new();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: this argument is a mutable reference, but not used mutably
|
|
--> $DIR/mut_key.rs:31:32
|
|
|
|
|
LL | fn should_not_take_this_arg(m: &mut HashMap<Key, usize>, _n: usize) -> HashSet<Key> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&HashMap<Key, usize>`
|
|
|
|
|
= note: `-D clippy::needless-pass-by-ref-mut` implied by `-D warnings`
|
|
|
|
error: aborting due to 18 previous errors
|
|
|