fork/rust

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

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

master
7.4 KiB205 linesraw
1error: iterating on a map's keys
2  --> $DIR/iter_kv_map.rs:14:13
3   |
4LL |     let _ = map.iter().map(|(key, _)| key).collect::<Vec<_>>();
5   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys()`
6   |
7   = note: `-D clippy::iter-kv-map` implied by `-D warnings`
8   = help: to override `-D warnings` add `#[allow(clippy::iter_kv_map)]`
9
10error: iterating on a map's values
11  --> $DIR/iter_kv_map.rs:15:13
12   |
13LL |     let _ = map.iter().map(|(_, value)| value).collect::<Vec<_>>();
14   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values()`
15
16error: iterating on a map's values
17  --> $DIR/iter_kv_map.rs:16:13
18   |
19LL |     let _ = map.iter().map(|(_, v)| v + 2).collect::<Vec<_>>();
20   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|v| v + 2)`
21
22error: iterating on a map's keys
23  --> $DIR/iter_kv_map.rs:18:13
24   |
25LL |     let _ = map.clone().into_iter().map(|(key, _)| key).collect::<Vec<_>>();
26   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_keys()`
27
28error: iterating on a map's keys
29  --> $DIR/iter_kv_map.rs:19:13
30   |
31LL |     let _ = map.clone().into_iter().map(|(key, _)| key + 2).collect::<Vec<_>>();
32   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_keys().map(|key| key + 2)`
33
34error: iterating on a map's values
35  --> $DIR/iter_kv_map.rs:21:13
36   |
37LL |     let _ = map.clone().into_iter().map(|(_, val)| val).collect::<Vec<_>>();
38   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values()`
39
40error: iterating on a map's values
41  --> $DIR/iter_kv_map.rs:22:13
42   |
43LL |     let _ = map.clone().into_iter().map(|(_, val)| val + 2).collect::<Vec<_>>();
44   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values().map(|val| val + 2)`
45
46error: iterating on a map's values
47  --> $DIR/iter_kv_map.rs:24:13
48   |
49LL |     let _ = map.clone().iter().map(|(_, val)| val).collect::<Vec<_>>();
50   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().values()`
51
52error: iterating on a map's keys
53  --> $DIR/iter_kv_map.rs:25:13
54   |
55LL |     let _ = map.iter().map(|(key, _)| key).filter(|x| *x % 2 == 0).count();
56   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys()`
57
58error: iterating on a map's keys
59  --> $DIR/iter_kv_map.rs:35:13
60   |
61LL |     let _ = map.iter().map(|(key, _value)| key * 9).count();
62   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys().map(|key| key * 9)`
63
64error: iterating on a map's values
65  --> $DIR/iter_kv_map.rs:36:13
66   |
67LL |     let _ = map.iter().map(|(_key, value)| value * 17).count();
68   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|value| value * 17)`
69
70error: iterating on a map's values
71  --> $DIR/iter_kv_map.rs:39:13
72   |
73LL |     let _ = map.clone().into_iter().map(|(_, ref val)| ref_acceptor(val)).count();
74   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values().map(|ref val| ref_acceptor(val))`
75
76error: iterating on a map's values
77  --> $DIR/iter_kv_map.rs:42:13
78   |
79LL |       let _ = map
80   |  _____________^
81LL | |         .clone()
82LL | |         .into_iter()
83LL | |         .map(|(_, mut val)| {
84LL | |             val += 2;
85LL | |             val
86LL | |         })
87   | |__________^
88   |
89help: try
90   |
91LL ~     let _ = map
92LL +         .clone().into_values().map(|mut val| {
93LL +             val += 2;
94LL +             val
95LL +         })
96   |
97
98error: iterating on a map's values
99  --> $DIR/iter_kv_map.rs:52:13
100   |
101LL |     let _ = map.clone().into_iter().map(|(_, mut val)| val).count();
102   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values()`
103
104error: iterating on a map's keys
105  --> $DIR/iter_kv_map.rs:56:13
106   |
107LL |     let _ = map.iter().map(|(key, _)| key).collect::<Vec<_>>();
108   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys()`
109
110error: iterating on a map's values
111  --> $DIR/iter_kv_map.rs:57:13
112   |
113LL |     let _ = map.iter().map(|(_, value)| value).collect::<Vec<_>>();
114   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values()`
115
116error: iterating on a map's values
117  --> $DIR/iter_kv_map.rs:58:13
118   |
119LL |     let _ = map.iter().map(|(_, v)| v + 2).collect::<Vec<_>>();
120   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|v| v + 2)`
121
122error: iterating on a map's keys
123  --> $DIR/iter_kv_map.rs:60:13
124   |
125LL |     let _ = map.clone().into_iter().map(|(key, _)| key).collect::<Vec<_>>();
126   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_keys()`
127
128error: iterating on a map's keys
129  --> $DIR/iter_kv_map.rs:61:13
130   |
131LL |     let _ = map.clone().into_iter().map(|(key, _)| key + 2).collect::<Vec<_>>();
132   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_keys().map(|key| key + 2)`
133
134error: iterating on a map's values
135  --> $DIR/iter_kv_map.rs:63:13
136   |
137LL |     let _ = map.clone().into_iter().map(|(_, val)| val).collect::<Vec<_>>();
138   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values()`
139
140error: iterating on a map's values
141  --> $DIR/iter_kv_map.rs:64:13
142   |
143LL |     let _ = map.clone().into_iter().map(|(_, val)| val + 2).collect::<Vec<_>>();
144   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values().map(|val| val + 2)`
145
146error: iterating on a map's values
147  --> $DIR/iter_kv_map.rs:66:13
148   |
149LL |     let _ = map.clone().iter().map(|(_, val)| val).collect::<Vec<_>>();
150   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().values()`
151
152error: iterating on a map's keys
153  --> $DIR/iter_kv_map.rs:67:13
154   |
155LL |     let _ = map.iter().map(|(key, _)| key).filter(|x| *x % 2 == 0).count();
156   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys()`
157
158error: iterating on a map's keys
159  --> $DIR/iter_kv_map.rs:77:13
160   |
161LL |     let _ = map.iter().map(|(key, _value)| key * 9).count();
162   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys().map(|key| key * 9)`
163
164error: iterating on a map's values
165  --> $DIR/iter_kv_map.rs:78:13
166   |
167LL |     let _ = map.iter().map(|(_key, value)| value * 17).count();
168   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|value| value * 17)`
169
170error: iterating on a map's values
171  --> $DIR/iter_kv_map.rs:81:13
172   |
173LL |     let _ = map.clone().into_iter().map(|(_, ref val)| ref_acceptor(val)).count();
174   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values().map(|ref val| ref_acceptor(val))`
175
176error: iterating on a map's values
177  --> $DIR/iter_kv_map.rs:84:13
178   |
179LL |       let _ = map
180   |  _____________^
181LL | |         .clone()
182LL | |         .into_iter()
183LL | |         .map(|(_, mut val)| {
184LL | |             val += 2;
185LL | |             val
186LL | |         })
187   | |__________^
188   |
189help: try
190   |
191LL ~     let _ = map
192LL +         .clone().into_values().map(|mut val| {
193LL +             val += 2;
194LL +             val
195LL +         })
196   |
197
198error: iterating on a map's values
199  --> $DIR/iter_kv_map.rs:94:13
200   |
201LL |     let _ = map.clone().into_iter().map(|(_, mut val)| val).count();
202   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values()`
203
204error: aborting due to 28 previous errors
205