fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
3.8 KiB116 linesraw
1error: mutable key type
2  --> $DIR/mut_key.rs:31:32
3   |
4LL | fn should_not_take_this_arg(m: &mut HashMap<Key, usize>, _n: usize) -> HashSet<Key> {
5   |                                ^^^^^^^^^^^^^^^^^^^^^^^^
6   |
7   = note: `-D clippy::mutable-key-type` implied by `-D warnings`
8   = help: to override `-D warnings` add `#[allow(clippy::mutable_key_type)]`
9
10error: mutable key type
11  --> $DIR/mut_key.rs:31:72
12   |
13LL | fn should_not_take_this_arg(m: &mut HashMap<Key, usize>, _n: usize) -> HashSet<Key> {
14   |                                                                        ^^^^^^^^^^^^
15
16error: mutable key type
17  --> $DIR/mut_key.rs:37:5
18   |
19LL |     let _other: HashMap<Key, bool> = HashMap::new();
20   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21
22error: mutable key type
23  --> $DIR/mut_key.rs:65:22
24   |
25LL | fn tuples_bad<U>(_m: &mut HashMap<(Key, U), bool>) {}
26   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27
28error: mutable key type
29  --> $DIR/mut_key.rs:78:5
30   |
31LL |     let _map = HashMap::<Cell<usize>, usize>::new();
32   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33
34error: mutable key type
35  --> $DIR/mut_key.rs:80:5
36   |
37LL |     let _map = HashMap::<&mut Cell<usize>, usize>::new();
38   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39
40error: mutable key type
41  --> $DIR/mut_key.rs:82:5
42   |
43LL |     let _map = HashMap::<&mut usize, usize>::new();
44   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45
46error: mutable key type
47  --> $DIR/mut_key.rs:85:5
48   |
49LL |     let _map = HashMap::<Vec<Cell<usize>>, usize>::new();
50   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
51
52error: mutable key type
53  --> $DIR/mut_key.rs:87:5
54   |
55LL |     let _map = HashMap::<BTreeMap<Cell<usize>, ()>, usize>::new();
56   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
57
58error: mutable key type
59  --> $DIR/mut_key.rs:89:5
60   |
61LL |     let _map = HashMap::<BTreeMap<(), Cell<usize>>, usize>::new();
62   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63
64error: mutable key type
65  --> $DIR/mut_key.rs:91:5
66   |
67LL |     let _map = HashMap::<BTreeSet<Cell<usize>>, usize>::new();
68   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
69
70error: mutable key type
71  --> $DIR/mut_key.rs:93:5
72   |
73LL |     let _map = HashMap::<Option<Cell<usize>>, usize>::new();
74   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75
76error: mutable key type
77  --> $DIR/mut_key.rs:95:5
78   |
79LL |     let _map = HashMap::<Option<Vec<Cell<usize>>>, usize>::new();
80   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
81
82error: mutable key type
83  --> $DIR/mut_key.rs:97:5
84   |
85LL |     let _map = HashMap::<Result<&mut usize, ()>, usize>::new();
86   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87
88error: mutable key type
89  --> $DIR/mut_key.rs:100:5
90   |
91LL |     let _map = HashMap::<Box<Cell<usize>>, usize>::new();
92   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93
94error: mutable key type
95  --> $DIR/mut_key.rs:102:5
96   |
97LL |     let _map = HashMap::<Rc<Cell<usize>>, usize>::new();
98   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
99
100error: mutable key type
101  --> $DIR/mut_key.rs:104:5
102   |
103LL |     let _map = HashMap::<Arc<Cell<usize>>, usize>::new();
104   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
105
106error: this argument is a mutable reference, but not used mutably
107  --> $DIR/mut_key.rs:31:32
108   |
109LL | fn should_not_take_this_arg(m: &mut HashMap<Key, usize>, _n: usize) -> HashSet<Key> {
110   |                                ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&HashMap<Key, usize>`
111   |
112   = note: `-D clippy::needless-pass-by-ref-mut` implied by `-D warnings`
113   = help: to override `-D warnings` add `#[allow(clippy::needless_pass_by_ref_mut)]`
114
115error: aborting due to 18 previous errors
116