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