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