fork/rust

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

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

master
8.0 KiB312 linesraw
1error[E0530]: match bindings cannot shadow tuple structs
2  --> $DIR/pat-tuple-overfield.rs:57:9
3   |
4LL | struct Z1();
5   | ------------ the tuple struct `Z1` is defined 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-overfield.rs:52:9
15   |
16LL | struct Z0;
17   | ---------- `Z0` defined here
18LL | struct Z1();
19   | ------------ similarly named tuple struct `Z1` defined here
20...
21LL |         Z0() => {}
22   |         ^^^^
23   |
24help: use this syntax instead
25   |
26LL |         Z0 => {}
27   |         ~~
28help: a tuple struct with a similar name exists
29   |
30LL |         Z1() => {}
31   |         ~~
32
33error[E0532]: expected tuple struct or tuple variant, found unit struct `Z0`
34  --> $DIR/pat-tuple-overfield.rs:53:9
35   |
36LL | struct Z0;
37   | ---------- `Z0` defined here
38LL | struct Z1();
39   | ------------ similarly named tuple struct `Z1` defined here
40...
41LL |         Z0(_) => {}
42   |         ^^^^^
43   |
44help: use this syntax instead
45   |
46LL |         Z0 => {}
47   |         ~~
48help: a tuple struct with a similar name exists
49   |
50LL |         Z1(_) => {}
51   |         ~~
52
53error[E0532]: expected tuple struct or tuple variant, found unit struct `Z0`
54  --> $DIR/pat-tuple-overfield.rs:54:9
55   |
56LL | struct Z0;
57   | ---------- `Z0` defined here
58LL | struct Z1();
59   | ------------ similarly named tuple struct `Z1` defined here
60...
61LL |         Z0(_, _) => {}
62   |         ^^^^^^^^
63   |
64help: use this syntax instead
65   |
66LL |         Z0 => {}
67   |         ~~
68help: a tuple struct with a similar name exists
69   |
70LL |         Z1(_, _) => {}
71   |         ~~
72
73error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0`
74  --> $DIR/pat-tuple-overfield.rs:64:9
75   |
76LL |     Z0,
77   |     -- `E1::Z0` defined here
78LL |     Z1(),
79   |     ---- similarly named tuple variant `Z1` defined here
80...
81LL |         E1::Z0() => {}
82   |         ^^^^^^^^
83   |
84help: use this syntax instead
85   |
86LL |         E1::Z0 => {}
87   |         ~~~~~~
88help: a tuple variant with a similar name exists
89   |
90LL |         E1::Z1() => {}
91   |             ~~
92
93error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0`
94  --> $DIR/pat-tuple-overfield.rs:65:9
95   |
96LL |     Z0,
97   |     -- `E1::Z0` defined here
98LL |     Z1(),
99   |     ---- similarly named tuple variant `Z1` defined here
100...
101LL |         E1::Z0(_) => {}
102   |         ^^^^^^^^^
103   |
104help: use this syntax instead
105   |
106LL |         E1::Z0 => {}
107   |         ~~~~~~
108help: a tuple variant with a similar name exists
109   |
110LL |         E1::Z1(_) => {}
111   |             ~~
112
113error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0`
114  --> $DIR/pat-tuple-overfield.rs:66:9
115   |
116LL |     Z0,
117   |     -- `E1::Z0` defined here
118LL |     Z1(),
119   |     ---- similarly named tuple variant `Z1` defined here
120...
121LL |         E1::Z0(_, _) => {}
122   |         ^^^^^^^^^^^^
123   |
124help: use this syntax instead
125   |
126LL |         E1::Z0 => {}
127   |         ~~~~~~
128help: a tuple variant with a similar name exists
129   |
130LL |         E1::Z1(_, _) => {}
131   |             ~~
132
133error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E1::Z1`
134  --> $DIR/pat-tuple-overfield.rs:69:9
135   |
136LL |     Z0,
137   |     -- similarly named unit variant `Z0` defined here
138LL |     Z1(),
139   |     ---- `E1::Z1` defined here
140...
141LL |         E1::Z1 => {}
142   |         ^^^^^^
143   |
144help: use the tuple variant pattern syntax instead
145   |
146LL |         E1::Z1() => {}
147   |         ~~~~~~~~
148help: a unit variant with a similar name exists
149   |
150LL |         E1::Z0 => {}
151   |             ~~
152
153error[E0308]: mismatched types
154  --> $DIR/pat-tuple-overfield.rs:19:9
155   |
156LL |     match (1, 2, 3) {
157   |           --------- this expression has type `({integer}, {integer}, {integer})`
158LL |         (1, 2, 3, 4) => {}
159   |         ^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 4 elements
160   |
161   = note: expected tuple `({integer}, {integer}, {integer})`
162              found tuple `(_, _, _, _)`
163
164error[E0308]: mismatched types
165  --> $DIR/pat-tuple-overfield.rs:20:9
166   |
167LL |     match (1, 2, 3) {
168   |           --------- this expression has type `({integer}, {integer}, {integer})`
169LL |         (1, 2, 3, 4) => {}
170LL |         (1, 2, .., 3, 4) => {}
171   |         ^^^^^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 4 elements
172   |
173   = note: expected tuple `({integer}, {integer}, {integer})`
174              found tuple `(_, _, _, _)`
175
176error[E0023]: this pattern has 4 fields, but the corresponding tuple struct has 3 fields
177  --> $DIR/pat-tuple-overfield.rs:24:11
178   |
179LL | struct S(u8, u8, u8);
180   |          --  --  -- tuple struct has 3 fields
181...
182LL |         S(1, 2, 3, 4) => {}
183   |           ^  ^  ^  ^ expected 3 fields, found 4
184
185error[E0023]: this pattern has 4 fields, but the corresponding tuple struct has 3 fields
186  --> $DIR/pat-tuple-overfield.rs:26:11
187   |
188LL | struct S(u8, u8, u8);
189   |          --  --  -- tuple struct has 3 fields
190...
191LL |         S(1, 2, .., 3, 4) => {}
192   |           ^  ^      ^  ^ expected 3 fields, found 4
193
194error[E0023]: this pattern has 6 fields, but the corresponding tuple struct has 5 fields
195  --> $DIR/pat-tuple-overfield.rs:31:11
196   |
197LL | struct M(
198   |        - tuple struct defined here
199LL |     u8,
200   |     --
201LL |     u8,
202   |     --
203LL |     u8,
204   |     --
205LL |     u8,
206   |     --
207LL |     u8,
208   |     -- tuple struct has 5 fields
209...
210LL |         M(1, 2, 3, 4, 5, 6) => {}
211   |           ^  ^  ^  ^  ^  ^ expected 5 fields, found 6
212
213error[E0023]: this pattern has 6 fields, but the corresponding tuple struct has 5 fields
214  --> $DIR/pat-tuple-overfield.rs:33:11
215   |
216LL | struct M(
217   |        - tuple struct defined here
218LL |     u8,
219   |     --
220LL |     u8,
221   |     --
222LL |     u8,
223   |     --
224LL |     u8,
225   |     --
226LL |     u8,
227   |     -- tuple struct has 5 fields
228...
229LL |         M(1,
230   |         - ^
231LL |           2,
232   |           ^
233LL |           3,
234   |           ^
235LL |           4,
236   |           ^
237LL |           5,
238   |           ^
239LL |           6) => {}
240   |           ^ expected 5 fields, found 6
241
242error[E0023]: this pattern has 6 fields, but the corresponding tuple struct has 5 fields
243  --> $DIR/pat-tuple-overfield.rs:41:13
244   |
245LL | struct M(
246   |        - tuple struct defined here
247LL |     u8,
248   |     --
249LL |     u8,
250   |     --
251LL |     u8,
252   |     --
253LL |     u8,
254   |     --
255LL |     u8,
256   |     -- tuple struct has 5 fields
257...
258LL |         M(
259   |         -
260LL |             1,
261   |             ^
262LL |             2,
263   |             ^
264LL |             3,
265   |             ^
266LL |             4,
267   |             ^
268LL |             5,
269   |             ^
270LL |             6,
271   |             ^ expected 5 fields, found 6
272
273error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 0 fields
274  --> $DIR/pat-tuple-overfield.rs:59:12
275   |
276LL | struct Z1();
277   | --------- tuple struct has 0 fields
278...
279LL |         Z1(_) => {}
280   |            ^ expected 0 fields, found 1
281
282error[E0023]: this pattern has 2 fields, but the corresponding tuple struct has 0 fields
283  --> $DIR/pat-tuple-overfield.rs:60:12
284   |
285LL | struct Z1();
286   | --------- tuple struct has 0 fields
287...
288LL |         Z1(_, _) => {}
289   |            ^  ^ expected 0 fields, found 2
290
291error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 0 fields
292  --> $DIR/pat-tuple-overfield.rs:71:16
293   |
294LL |     Z1(),
295   |     -- tuple variant has 0 fields
296...
297LL |         E1::Z1(_) => {}
298   |                ^ expected 0 fields, found 1
299
300error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 0 fields
301  --> $DIR/pat-tuple-overfield.rs:72:16
302   |
303LL |     Z1(),
304   |     -- tuple variant has 0 fields
305...
306LL |         E1::Z1(_, _) => {}
307   |                ^  ^ expected 0 fields, found 2
308
309error: aborting due to 19 previous errors
310
311Some errors have detailed explanations: E0023, E0308, E0530, E0532.
312For more information about an error, try `rustc --explain E0023`.