fork/rust

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

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

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