]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/iter_kv_map.stderr
New upstream version 1.76.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / iter_kv_map.stderr
CommitLineData
2b03887a 1error: iterating on a map's keys
781aab86 2 --> $DIR/iter_kv_map.rs:14:13
2b03887a
FG
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`
781aab86 8 = help: to override `-D warnings` add `#[allow(clippy::iter_kv_map)]`
2b03887a
FG
9
10error: iterating on a map's values
781aab86 11 --> $DIR/iter_kv_map.rs:15:13
2b03887a
FG
12 |
13LL | let _ = map.iter().map(|(_, value)| value).collect::<Vec<_>>();
14 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values()`
15
16error: iterating on a map's values
781aab86 17 --> $DIR/iter_kv_map.rs:16:13
2b03887a
FG
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
781aab86 23 --> $DIR/iter_kv_map.rs:18:13
2b03887a
FG
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
781aab86 29 --> $DIR/iter_kv_map.rs:19:13
2b03887a
FG
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
781aab86 35 --> $DIR/iter_kv_map.rs:21:13
2b03887a
FG
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
781aab86 41 --> $DIR/iter_kv_map.rs:22:13
2b03887a
FG
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
781aab86 47 --> $DIR/iter_kv_map.rs:24:13
2b03887a
FG
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
781aab86 53 --> $DIR/iter_kv_map.rs:25:13
2b03887a
FG
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
781aab86 59 --> $DIR/iter_kv_map.rs:35:13
2b03887a
FG
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
781aab86 65 --> $DIR/iter_kv_map.rs:36:13
2b03887a
FG
66 |
67LL | let _ = map.iter().map(|(_key, value)| value * 17).count();
68 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|value| value * 17)`
69
9c376795 70error: iterating on a map's values
781aab86 71 --> $DIR/iter_kv_map.rs:39:13
2b03887a 72 |
9c376795
FG
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
781aab86 77 --> $DIR/iter_kv_map.rs:42:13
9c376795
FG
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
781aab86 99 --> $DIR/iter_kv_map.rs:52:13
9c376795
FG
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
781aab86 105 --> $DIR/iter_kv_map.rs:56:13
9c376795 106 |
2b03887a
FG
107LL | let _ = map.iter().map(|(key, _)| key).collect::<Vec<_>>();
108 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys()`
109
110error: iterating on a map's values
781aab86 111 --> $DIR/iter_kv_map.rs:57:13
2b03887a
FG
112 |
113LL | let _ = map.iter().map(|(_, value)| value).collect::<Vec<_>>();
114 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values()`
115
116error: iterating on a map's values
781aab86 117 --> $DIR/iter_kv_map.rs:58:13
2b03887a
FG
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
781aab86 123 --> $DIR/iter_kv_map.rs:60:13
2b03887a
FG
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
781aab86 129 --> $DIR/iter_kv_map.rs:61:13
2b03887a
FG
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
781aab86 135 --> $DIR/iter_kv_map.rs:63:13
2b03887a
FG
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
781aab86 141 --> $DIR/iter_kv_map.rs:64:13
2b03887a
FG
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
781aab86 147 --> $DIR/iter_kv_map.rs:66:13
2b03887a
FG
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
781aab86 153 --> $DIR/iter_kv_map.rs:67:13
2b03887a
FG
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
781aab86 159 --> $DIR/iter_kv_map.rs:77:13
2b03887a
FG
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
781aab86 165 --> $DIR/iter_kv_map.rs:78:13
2b03887a
FG
166 |
167LL | let _ = map.iter().map(|(_key, value)| value * 17).count();
168 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|value| value * 17)`
169
9c376795 170error: iterating on a map's values
781aab86 171 --> $DIR/iter_kv_map.rs:81:13
9c376795
FG
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
781aab86 177 --> $DIR/iter_kv_map.rs:84:13
9c376795
FG
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
781aab86 199 --> $DIR/iter_kv_map.rs:94:13
9c376795
FG
200 |
201LL | let _ = map.clone().into_iter().map(|(_, mut val)| val).count();
202 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values()`
203
4b012472
FG
204error: iterating on a map's keys
205 --> $DIR/iter_kv_map.rs:109:13
206 |
207LL | let _ = map.iter().map(|(key, _)| key).collect::<Vec<_>>();
208 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys()`
209
210error: iterating on a map's values
211 --> $DIR/iter_kv_map.rs:111:13
212 |
213LL | let _ = map.iter().map(|(_, value)| value).collect::<Vec<_>>();
214 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values()`
215
216error: iterating on a map's values
217 --> $DIR/iter_kv_map.rs:113:13
218 |
219LL | let _ = map.iter().map(|(_, v)| v + 2).collect::<Vec<_>>();
220 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|v| v + 2)`
221
222error: iterating on a map's keys
223 --> $DIR/iter_kv_map.rs:122:13
224 |
225LL | let _ = map.clone().into_iter().map(|(key, _)| key).collect::<Vec<_>>();
226 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_keys()`
227
228error: iterating on a map's keys
229 --> $DIR/iter_kv_map.rs:124:13
230 |
231LL | let _ = map.clone().into_iter().map(|(key, _)| key + 2).collect::<Vec<_>>();
232 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_keys().map(|key| key + 2)`
233
234error: iterating on a map's values
235 --> $DIR/iter_kv_map.rs:127:13
236 |
237LL | let _ = map.clone().into_iter().map(|(_, val)| val).collect::<Vec<_>>();
238 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values()`
239
240error: iterating on a map's values
241 --> $DIR/iter_kv_map.rs:129:13
242 |
243LL | let _ = map.clone().into_iter().map(|(_, val)| val + 2).collect::<Vec<_>>();
244 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.clone().into_values().map(|val| val + 2)`
245
246error: iterating on a map's keys
247 --> $DIR/iter_kv_map.rs:132:13
248 |
249LL | let _ = map.iter().map(|(key, _)| key).collect::<Vec<_>>();
250 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.keys()`
251
252error: iterating on a map's values
253 --> $DIR/iter_kv_map.rs:134:13
254 |
255LL | let _ = map.iter().map(|(_, value)| value).collect::<Vec<_>>();
256 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values()`
257
258error: iterating on a map's values
259 --> $DIR/iter_kv_map.rs:136:13
260 |
261LL | let _ = map.iter().map(|(_, v)| v + 2).collect::<Vec<_>>();
262 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.values().map(|v| v + 2)`
263
264error: aborting due to 38 previous errors
2b03887a 265