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