]>
Commit | Line | Data |
---|---|---|
94222f64 XL |
1 | error[E0530]: match bindings cannot shadow tuple structs |
2 | --> $DIR/pat-tuple-field-count-cross.rs:13:9 | |
3 | | | |
4 | LL | use declarations_for_tuple_field_count_errors::*; | |
5 | | -------------------------------------------- the tuple struct `Z1` is imported here | |
6 | ... | |
7 | LL | Z1 => {} | |
8 | | ^^ cannot be named the same as a tuple struct | |
9 | ||
10 | error[E0532]: expected tuple struct or tuple variant, found unit struct `Z0` | |
11 | --> $DIR/pat-tuple-field-count-cross.rs:9:9 | |
12 | | | |
13 | LL | Z0() => {} | |
14 | | ^^^^ | |
15 | | | |
16 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:1:1 | |
17 | | | |
18 | LL | pub struct Z0; | |
19 | | -------------- `Z0` defined here | |
20 | LL | pub struct Z1(); | |
21 | | ---------------- similarly named tuple struct `Z1` defined here | |
22 | | | |
23 | help: use this syntax instead | |
24 | | | |
25 | LL | Z0 => {} | |
26 | | ~~ | |
27 | help: a tuple struct with a similar name exists | |
28 | | | |
29 | LL | Z1() => {} | |
30 | | ~~ | |
31 | ||
32 | error[E0532]: expected tuple struct or tuple variant, found unit struct `Z0` | |
33 | --> $DIR/pat-tuple-field-count-cross.rs:10:9 | |
34 | | | |
35 | LL | Z0(x) => {} | |
36 | | ^^^^^ | |
37 | | | |
38 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:1:1 | |
39 | | | |
40 | LL | pub struct Z0; | |
41 | | -------------- `Z0` defined here | |
42 | LL | pub struct Z1(); | |
43 | | ---------------- similarly named tuple struct `Z1` defined here | |
44 | | | |
45 | help: use this syntax instead | |
46 | | | |
47 | LL | Z0 => {} | |
48 | | ~~ | |
49 | help: a tuple struct with a similar name exists | |
50 | | | |
51 | LL | Z1(x) => {} | |
52 | | ~~ | |
53 | ||
54 | error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0` | |
55 | --> $DIR/pat-tuple-field-count-cross.rs:31:9 | |
56 | | | |
57 | LL | E1::Z0() => {} | |
58 | | ^^^^^^^^ | |
59 | | | |
60 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:11:15 | |
61 | | | |
62 | LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) } | |
63 | | -- ---- similarly named tuple variant `Z1` defined here | |
64 | | | | |
65 | | `E1::Z0` defined here | |
66 | | | |
67 | help: use this syntax instead | |
68 | | | |
69 | LL | E1::Z0 => {} | |
70 | | ~~~~~~ | |
71 | help: a tuple variant with a similar name exists | |
72 | | | |
73 | LL | E1::Z1() => {} | |
74 | | ~~ | |
75 | ||
76 | error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0` | |
77 | --> $DIR/pat-tuple-field-count-cross.rs:32:9 | |
78 | | | |
79 | LL | E1::Z0(x) => {} | |
80 | | ^^^^^^^^^ | |
81 | | | |
82 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:11:15 | |
83 | | | |
84 | LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) } | |
85 | | -- ---- similarly named tuple variant `Z1` defined here | |
86 | | | | |
87 | | `E1::Z0` defined here | |
88 | | | |
89 | help: use this syntax instead | |
90 | | | |
91 | LL | E1::Z0 => {} | |
92 | | ~~~~~~ | |
93 | help: a tuple variant with a similar name exists | |
94 | | | |
95 | LL | E1::Z1(x) => {} | |
96 | | ~~ | |
97 | ||
98 | error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E1::Z1` | |
99 | --> $DIR/pat-tuple-field-count-cross.rs:35:9 | |
100 | | | |
101 | LL | E1::Z1 => {} | |
102 | | ^^^^^^ | |
103 | | | |
104 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:11:19 | |
105 | | | |
106 | LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) } | |
107 | | -- ---- `E1::Z1` defined here | |
108 | | | | |
109 | | similarly named unit variant `Z0` defined here | |
110 | | | |
111 | help: use the tuple variant pattern syntax instead | |
112 | | | |
113 | LL | E1::Z1(/* fields */) => {} | |
114 | | ~~~~~~~~~~~~~~~~~~~~ | |
115 | help: a unit variant with a similar name exists | |
116 | | | |
117 | LL | E1::Z0 => {} | |
118 | | ~~ | |
119 | ||
120 | error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 0 fields | |
121 | --> $DIR/pat-tuple-field-count-cross.rs:14:12 | |
122 | | | |
123 | LL | Z1(x) => {} | |
124 | | ^ expected 0 fields, found 1 | |
125 | | | |
126 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:2:1 | |
127 | | | |
128 | LL | pub struct Z1(); | |
129 | | ---------------- tuple struct has 0 fields | |
130 | ||
131 | error[E0023]: this pattern has 0 fields, but the corresponding tuple struct has 3 fields | |
132 | --> $DIR/pat-tuple-field-count-cross.rs:18:9 | |
133 | | | |
134 | LL | S() => {} | |
135 | | ^^^ expected 3 fields, found 0 | |
136 | | | |
137 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:4:14 | |
138 | | | |
139 | LL | pub struct S(pub u8, pub u8, pub u8); | |
140 | | ------ ------ ------ tuple struct has 3 fields | |
141 | | | |
142 | help: use `_` to explicitly ignore each field | |
143 | | | |
144 | LL | S(_, _, _) => {} | |
145 | | +++++++ | |
146 | help: use `..` to ignore all fields | |
147 | | | |
148 | LL | S(..) => {} | |
149 | | ++ | |
150 | ||
151 | error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 3 fields | |
152 | --> $DIR/pat-tuple-field-count-cross.rs:19:11 | |
153 | | | |
154 | LL | S(1) => {} | |
155 | | ^ expected 3 fields, found 1 | |
156 | | | |
157 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:4:14 | |
158 | | | |
159 | LL | pub struct S(pub u8, pub u8, pub u8); | |
160 | | ------ ------ ------ tuple struct has 3 fields | |
161 | | | |
162 | help: use `_` to explicitly ignore each field | |
163 | | | |
164 | LL | S(1, _, _) => {} | |
165 | | ++++++ | |
166 | help: use `..` to ignore the rest of the fields | |
167 | | | |
168 | LL | S(1, ..) => {} | |
169 | | ++++ | |
170 | ||
171 | error[E0023]: this pattern has 2 fields, but the corresponding tuple struct has 3 fields | |
172 | --> $DIR/pat-tuple-field-count-cross.rs:20:11 | |
173 | | | |
174 | LL | S(xyz, abc) => {} | |
175 | | ^^^ ^^^ expected 3 fields, found 2 | |
176 | | | |
177 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:4:14 | |
178 | | | |
179 | LL | pub struct S(pub u8, pub u8, pub u8); | |
180 | | ------ ------ ------ tuple struct has 3 fields | |
181 | | | |
182 | help: use `_` to explicitly ignore each field | |
183 | | | |
184 | LL | S(xyz, abc, _) => {} | |
185 | | +++ | |
186 | ||
187 | error[E0023]: this pattern has 4 fields, but the corresponding tuple struct has 3 fields | |
188 | --> $DIR/pat-tuple-field-count-cross.rs:21:11 | |
189 | | | |
190 | LL | S(1, 2, 3, 4) => {} | |
191 | | ^ ^ ^ ^ expected 3 fields, found 4 | |
192 | | | |
193 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:4:14 | |
194 | | | |
195 | LL | pub struct S(pub u8, pub u8, pub u8); | |
196 | | ------ ------ ------ tuple struct has 3 fields | |
197 | ||
198 | error[E0023]: this pattern has 0 fields, but the corresponding tuple struct has 3 fields | |
199 | --> $DIR/pat-tuple-field-count-cross.rs:24:9 | |
200 | | | |
923072b8 FG |
201 | LL | M() => {} |
202 | | ^^^ expected 3 fields, found 0 | |
94222f64 | 203 | | |
923072b8 | 204 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:5:12 |
94222f64 | 205 | | |
923072b8 FG |
206 | LL | pub struct M( |
207 | | - tuple struct defined here | |
208 | LL | pub u8, | |
209 | | ------ | |
210 | LL | pub u8, | |
211 | | ------ | |
212 | LL | pub u8, | |
213 | | ------ tuple struct has 3 fields | |
94222f64 XL |
214 | | |
215 | help: use `_` to explicitly ignore each field | |
216 | | | |
217 | LL | M(_, _, _) => {} | |
218 | | +++++++ | |
219 | help: use `..` to ignore all fields | |
220 | | | |
221 | LL | M(..) => {} | |
222 | | ++ | |
223 | ||
224 | error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 3 fields | |
225 | --> $DIR/pat-tuple-field-count-cross.rs:25:11 | |
226 | | | |
923072b8 FG |
227 | LL | M(1) => {} |
228 | | ^ expected 3 fields, found 1 | |
94222f64 | 229 | | |
923072b8 | 230 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:5:12 |
94222f64 | 231 | | |
923072b8 FG |
232 | LL | pub struct M( |
233 | | - tuple struct defined here | |
234 | LL | pub u8, | |
235 | | ------ | |
236 | LL | pub u8, | |
237 | | ------ | |
238 | LL | pub u8, | |
239 | | ------ tuple struct has 3 fields | |
94222f64 XL |
240 | | |
241 | help: use `_` to explicitly ignore each field | |
242 | | | |
243 | LL | M(1, _, _) => {} | |
244 | | ++++++ | |
245 | help: use `..` to ignore the rest of the fields | |
246 | | | |
247 | LL | M(1, ..) => {} | |
248 | | ++++ | |
249 | ||
250 | error[E0023]: this pattern has 2 fields, but the corresponding tuple struct has 3 fields | |
251 | --> $DIR/pat-tuple-field-count-cross.rs:26:11 | |
252 | | | |
923072b8 FG |
253 | LL | M(xyz, abc) => {} |
254 | | ^^^ ^^^ expected 3 fields, found 2 | |
94222f64 | 255 | | |
923072b8 | 256 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:5:12 |
94222f64 | 257 | | |
923072b8 FG |
258 | LL | pub struct M( |
259 | | - tuple struct defined here | |
260 | LL | pub u8, | |
261 | | ------ | |
262 | LL | pub u8, | |
263 | | ------ | |
264 | LL | pub u8, | |
265 | | ------ tuple struct has 3 fields | |
94222f64 XL |
266 | | |
267 | help: use `_` to explicitly ignore each field | |
268 | | | |
269 | LL | M(xyz, abc, _) => {} | |
270 | | +++ | |
271 | ||
272 | error[E0023]: this pattern has 4 fields, but the corresponding tuple struct has 3 fields | |
273 | --> $DIR/pat-tuple-field-count-cross.rs:27:11 | |
274 | | | |
923072b8 FG |
275 | LL | M(1, 2, 3, 4) => {} |
276 | | ^ ^ ^ ^ expected 3 fields, found 4 | |
94222f64 | 277 | | |
923072b8 | 278 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:5:12 |
94222f64 | 279 | | |
923072b8 FG |
280 | LL | pub struct M( |
281 | | - tuple struct defined here | |
282 | LL | pub u8, | |
283 | | ------ | |
284 | LL | pub u8, | |
285 | | ------ | |
286 | LL | pub u8, | |
287 | | ------ tuple struct has 3 fields | |
94222f64 XL |
288 | |
289 | error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 0 fields | |
290 | --> $DIR/pat-tuple-field-count-cross.rs:36:16 | |
291 | | | |
292 | LL | E1::Z1(x) => {} | |
293 | | ^ expected 0 fields, found 1 | |
294 | | | |
295 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:11:19 | |
296 | | | |
297 | LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) } | |
298 | | ---- tuple variant has 0 fields | |
299 | ||
300 | error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 3 fields | |
301 | --> $DIR/pat-tuple-field-count-cross.rs:39:9 | |
302 | | | |
303 | LL | E1::S() => {} | |
304 | | ^^^^^^^ expected 3 fields, found 0 | |
305 | | | |
306 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:11:27 | |
307 | | | |
308 | LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) } | |
309 | | -- -- -- tuple variant has 3 fields | |
310 | | | |
311 | help: use `_` to explicitly ignore each field | |
312 | | | |
313 | LL | E1::S(_, _, _) => {} | |
314 | | +++++++ | |
315 | help: use `..` to ignore all fields | |
316 | | | |
317 | LL | E1::S(..) => {} | |
318 | | ++ | |
319 | ||
320 | error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 3 fields | |
321 | --> $DIR/pat-tuple-field-count-cross.rs:40:15 | |
322 | | | |
323 | LL | E1::S(1) => {} | |
324 | | ^ expected 3 fields, found 1 | |
325 | | | |
326 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:11:27 | |
327 | | | |
328 | LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) } | |
329 | | -- -- -- tuple variant has 3 fields | |
330 | | | |
331 | help: use `_` to explicitly ignore each field | |
332 | | | |
333 | LL | E1::S(1, _, _) => {} | |
334 | | ++++++ | |
335 | help: use `..` to ignore the rest of the fields | |
336 | | | |
337 | LL | E1::S(1, ..) => {} | |
338 | | ++++ | |
339 | ||
340 | error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields | |
341 | --> $DIR/pat-tuple-field-count-cross.rs:41:15 | |
342 | | | |
343 | LL | E1::S(xyz, abc) => {} | |
344 | | ^^^ ^^^ expected 3 fields, found 2 | |
345 | | | |
346 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:11:27 | |
347 | | | |
348 | LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) } | |
349 | | -- -- -- tuple variant has 3 fields | |
350 | | | |
351 | help: use `_` to explicitly ignore each field | |
352 | | | |
353 | LL | E1::S(xyz, abc, _) => {} | |
354 | | +++ | |
355 | ||
356 | error[E0023]: this pattern has 4 fields, but the corresponding tuple variant has 3 fields | |
357 | --> $DIR/pat-tuple-field-count-cross.rs:42:15 | |
358 | | | |
359 | LL | E1::S(1, 2, 3, 4) => {} | |
360 | | ^ ^ ^ ^ expected 3 fields, found 4 | |
361 | | | |
362 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:11:27 | |
363 | | | |
364 | LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) } | |
365 | | -- -- -- tuple variant has 3 fields | |
366 | ||
367 | error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 3 fields | |
368 | --> $DIR/pat-tuple-field-count-cross.rs:46:9 | |
369 | | | |
370 | LL | E2::S() => {} | |
371 | | ^^^^^^^ expected 3 fields, found 0 | |
372 | | | |
373 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:14:7 | |
374 | | | |
375 | LL | S(u8, u8, u8), | |
376 | | -- -- -- tuple variant has 3 fields | |
377 | | | |
378 | help: use `_` to explicitly ignore each field | |
379 | | | |
380 | LL | E2::S(_, _, _) => {} | |
381 | | +++++++ | |
382 | help: use `..` to ignore all fields | |
383 | | | |
384 | LL | E2::S(..) => {} | |
385 | | ++ | |
386 | ||
387 | error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 3 fields | |
388 | --> $DIR/pat-tuple-field-count-cross.rs:47:15 | |
389 | | | |
390 | LL | E2::S(1) => {} | |
391 | | ^ expected 3 fields, found 1 | |
392 | | | |
393 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:14:7 | |
394 | | | |
395 | LL | S(u8, u8, u8), | |
396 | | -- -- -- tuple variant has 3 fields | |
397 | | | |
398 | help: use `_` to explicitly ignore each field | |
399 | | | |
400 | LL | E2::S(1, _, _) => {} | |
401 | | ++++++ | |
402 | help: use `..` to ignore the rest of the fields | |
403 | | | |
404 | LL | E2::S(1, ..) => {} | |
405 | | ++++ | |
406 | ||
407 | error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields | |
408 | --> $DIR/pat-tuple-field-count-cross.rs:48:15 | |
409 | | | |
410 | LL | E2::S(xyz, abc) => {} | |
411 | | ^^^ ^^^ expected 3 fields, found 2 | |
412 | | | |
413 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:14:7 | |
414 | | | |
415 | LL | S(u8, u8, u8), | |
416 | | -- -- -- tuple variant has 3 fields | |
417 | | | |
418 | help: use `_` to explicitly ignore each field | |
419 | | | |
420 | LL | E2::S(xyz, abc, _) => {} | |
421 | | +++ | |
422 | ||
423 | error[E0023]: this pattern has 4 fields, but the corresponding tuple variant has 3 fields | |
424 | --> $DIR/pat-tuple-field-count-cross.rs:49:15 | |
425 | | | |
426 | LL | E2::S(1, 2, 3, 4) => {} | |
427 | | ^ ^ ^ ^ expected 3 fields, found 4 | |
428 | | | |
429 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:14:7 | |
430 | | | |
431 | LL | S(u8, u8, u8), | |
432 | | -- -- -- tuple variant has 3 fields | |
433 | ||
434 | error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 3 fields | |
435 | --> $DIR/pat-tuple-field-count-cross.rs:52:9 | |
436 | | | |
923072b8 FG |
437 | LL | E2::M() => {} |
438 | | ^^^^^^^ expected 3 fields, found 0 | |
94222f64 XL |
439 | | |
440 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:15:5 | |
441 | | | |
923072b8 FG |
442 | LL | M( |
443 | | - tuple variant defined here | |
444 | LL | u8, | |
445 | | -- | |
446 | LL | u8, | |
447 | | -- | |
448 | LL | u8, | |
449 | | -- tuple variant has 3 fields | |
94222f64 XL |
450 | | |
451 | help: use `_` to explicitly ignore each field | |
452 | | | |
453 | LL | E2::M(_, _, _) => {} | |
454 | | +++++++ | |
455 | help: use `..` to ignore all fields | |
456 | | | |
457 | LL | E2::M(..) => {} | |
458 | | ++ | |
459 | ||
460 | error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 3 fields | |
461 | --> $DIR/pat-tuple-field-count-cross.rs:53:15 | |
462 | | | |
923072b8 FG |
463 | LL | E2::M(1) => {} |
464 | | ^ expected 3 fields, found 1 | |
94222f64 XL |
465 | | |
466 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:15:5 | |
467 | | | |
923072b8 FG |
468 | LL | M( |
469 | | - tuple variant defined here | |
470 | LL | u8, | |
471 | | -- | |
472 | LL | u8, | |
473 | | -- | |
474 | LL | u8, | |
475 | | -- tuple variant has 3 fields | |
94222f64 XL |
476 | | |
477 | help: use `_` to explicitly ignore each field | |
478 | | | |
479 | LL | E2::M(1, _, _) => {} | |
480 | | ++++++ | |
481 | help: use `..` to ignore the rest of the fields | |
482 | | | |
483 | LL | E2::M(1, ..) => {} | |
484 | | ++++ | |
485 | ||
486 | error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields | |
487 | --> $DIR/pat-tuple-field-count-cross.rs:54:15 | |
488 | | | |
923072b8 FG |
489 | LL | E2::M(xyz, abc) => {} |
490 | | ^^^ ^^^ expected 3 fields, found 2 | |
94222f64 XL |
491 | | |
492 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:15:5 | |
493 | | | |
923072b8 FG |
494 | LL | M( |
495 | | - tuple variant defined here | |
496 | LL | u8, | |
497 | | -- | |
498 | LL | u8, | |
499 | | -- | |
500 | LL | u8, | |
501 | | -- tuple variant has 3 fields | |
94222f64 XL |
502 | | |
503 | help: use `_` to explicitly ignore each field | |
504 | | | |
505 | LL | E2::M(xyz, abc, _) => {} | |
506 | | +++ | |
507 | ||
508 | error[E0023]: this pattern has 4 fields, but the corresponding tuple variant has 3 fields | |
509 | --> $DIR/pat-tuple-field-count-cross.rs:55:15 | |
510 | | | |
923072b8 FG |
511 | LL | E2::M(1, 2, 3, 4) => {} |
512 | | ^ ^ ^ ^ expected 3 fields, found 4 | |
94222f64 XL |
513 | | |
514 | ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:15:5 | |
515 | | | |
923072b8 FG |
516 | LL | M( |
517 | | - tuple variant defined here | |
518 | LL | u8, | |
519 | | -- | |
520 | LL | u8, | |
521 | | -- | |
522 | LL | u8, | |
523 | | -- tuple variant has 3 fields | |
94222f64 XL |
524 | |
525 | error: aborting due to 28 previous errors | |
526 | ||
527 | Some errors have detailed explanations: E0023, E0530, E0532. | |
528 | For more information about an error, try `rustc --explain E0023`. |