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