]> git.proxmox.com Git - rustc.git/blame - src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / type-alias-enum-variants / enum-variant-generic-args.stderr
CommitLineData
0731742a 1error[E0308]: mismatched types
dc9dc135 2 --> $DIR/enum-variant-generic-args.rs:13:25
0731742a 3 |
60c5eb7d
XL
4LL | impl<T> Enum<T> {
5 | - this type parameter
6LL | fn ts_variant() {
0731742a 7LL | Self::TSVariant(());
923072b8
FG
8 | --------------- ^^ expected type parameter `T`, found `()`
9 | |
064997fb 10 | arguments to this enum variant are incorrect
0731742a 11 |
60c5eb7d
XL
12 = note: expected type parameter `T`
13 found unit type `()`
923072b8
FG
14note: tuple variant defined here
15 --> $DIR/enum-variant-generic-args.rs:7:16
16 |
17LL | enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
18 | ^^^^^^^^^
0731742a 19
923072b8 20error[E0109]: type arguments are not allowed on this type
dc9dc135 21 --> $DIR/enum-variant-generic-args.rs:15:27
0731742a
XL
22 |
23LL | Self::TSVariant::<()>(());
923072b8
FG
24 | --------- ^^ type argument not allowed
25 | |
26 | not allowed on this type
0731742a 27
923072b8 28error[E0109]: type arguments are not allowed on self type
dc9dc135 29 --> $DIR/enum-variant-generic-args.rs:17:16
0731742a
XL
30 |
31LL | Self::<()>::TSVariant(());
923072b8
FG
32 | ---- ^^ type argument not allowed
33 | |
34 | not allowed on self type
35 |
36note: `Self` is of type `Enum<T>`
37 --> $DIR/enum-variant-generic-args.rs:7:6
38 |
39LL | enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
40 | ^^^^ `Self` corresponds to this type
41...
42LL | impl<T> Enum<T> {
43 | --------------- `Self` is on type `Enum` in this `impl`
44help: the `Self` type doesn't accept type parameters, use the concrete type's name `Enum` instead if you want to specify its type parameters
45 |
46LL | Enum::<()>::TSVariant(());
47 | ~~~~
0731742a
XL
48
49error[E0308]: mismatched types
dc9dc135 50 --> $DIR/enum-variant-generic-args.rs:17:31
0731742a 51 |
60c5eb7d
XL
52LL | impl<T> Enum<T> {
53 | - this type parameter
54...
0731742a 55LL | Self::<()>::TSVariant(());
923072b8
FG
56 | --------------------- ^^ expected type parameter `T`, found `()`
57 | |
064997fb 58 | arguments to this enum variant are incorrect
0731742a 59 |
60c5eb7d
XL
60 = note: expected type parameter `T`
61 found unit type `()`
923072b8
FG
62note: tuple variant defined here
63 --> $DIR/enum-variant-generic-args.rs:7:16
64 |
65LL | enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
66 | ^^^^^^^^^
0731742a 67
923072b8 68error[E0109]: type arguments are not allowed on self type
dc9dc135 69 --> $DIR/enum-variant-generic-args.rs:20:16
0731742a
XL
70 |
71LL | Self::<()>::TSVariant::<()>(());
923072b8
FG
72 | ---- ^^ type argument not allowed
73 | |
74 | not allowed on self type
75 |
76note: `Self` is of type `Enum<T>`
77 --> $DIR/enum-variant-generic-args.rs:7:6
78 |
79LL | enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
80 | ^^^^ `Self` corresponds to this type
81...
82LL | impl<T> Enum<T> {
83 | --------------- `Self` is on type `Enum` in this `impl`
84help: the `Self` type doesn't accept type parameters, use the concrete type's name `Enum` instead if you want to specify its type parameters
85 |
86LL | Enum::<()>::TSVariant::<()>(());
87 | ~~~~
0731742a 88
923072b8 89error[E0109]: type arguments are not allowed on this type
dc9dc135 90 --> $DIR/enum-variant-generic-args.rs:20:33
0731742a
XL
91 |
92LL | Self::<()>::TSVariant::<()>(());
923072b8
FG
93 | --------- ^^ type argument not allowed
94 | |
95 | not allowed on this type
0731742a
XL
96
97error[E0308]: mismatched types
dc9dc135 98 --> $DIR/enum-variant-generic-args.rs:26:29
0731742a 99 |
60c5eb7d
XL
100LL | impl<T> Enum<T> {
101 | - this type parameter
102...
0731742a 103LL | Self::SVariant { v: () };
60c5eb7d 104 | ^^ expected type parameter `T`, found `()`
0731742a 105 |
60c5eb7d
XL
106 = note: expected type parameter `T`
107 found unit type `()`
0731742a 108
923072b8 109error[E0109]: type arguments are not allowed on this type
dc9dc135 110 --> $DIR/enum-variant-generic-args.rs:28:26
0731742a
XL
111 |
112LL | Self::SVariant::<()> { v: () };
923072b8
FG
113 | -------- ^^ type argument not allowed
114 | |
115 | not allowed on this type
116 |
117 = note: enum variants can't have type parameters
118help: you might have meant to specity type parameters on enum `Enum`
119 |
120LL - Self::SVariant::<()> { v: () };
121LL + Enum::<()>::SVariant { v: () };
122 |
0731742a
XL
123
124error[E0308]: mismatched types
dc9dc135 125 --> $DIR/enum-variant-generic-args.rs:28:35
0731742a 126 |
60c5eb7d
XL
127LL | impl<T> Enum<T> {
128 | - this type parameter
129...
0731742a 130LL | Self::SVariant::<()> { v: () };
60c5eb7d 131 | ^^ expected type parameter `T`, found `()`
0731742a 132 |
60c5eb7d
XL
133 = note: expected type parameter `T`
134 found unit type `()`
0731742a 135
923072b8 136error[E0109]: type arguments are not allowed on self type
dc9dc135 137 --> $DIR/enum-variant-generic-args.rs:31:16
0731742a
XL
138 |
139LL | Self::<()>::SVariant { v: () };
923072b8
FG
140 | ---- ^^ type argument not allowed
141 | |
142 | not allowed on self type
143 |
144note: `Self` is of type `Enum<T>`
145 --> $DIR/enum-variant-generic-args.rs:7:6
146 |
147LL | enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
148 | ^^^^ `Self` corresponds to this type
149...
150LL | impl<T> Enum<T> {
151 | --------------- `Self` is on type `Enum` in this `impl`
152help: the `Self` type doesn't accept type parameters, use the concrete type's name `Enum` instead if you want to specify its type parameters
153 |
154LL | Enum::<()>::SVariant { v: () };
155 | ~~~~
0731742a
XL
156
157error[E0308]: mismatched types
dc9dc135 158 --> $DIR/enum-variant-generic-args.rs:31:35
0731742a 159 |
60c5eb7d
XL
160LL | impl<T> Enum<T> {
161 | - this type parameter
162...
0731742a 163LL | Self::<()>::SVariant { v: () };
60c5eb7d 164 | ^^ expected type parameter `T`, found `()`
0731742a 165 |
60c5eb7d
XL
166 = note: expected type parameter `T`
167 found unit type `()`
0731742a 168
923072b8 169error[E0109]: type arguments are not allowed on self type
dc9dc135 170 --> $DIR/enum-variant-generic-args.rs:34:16
0731742a
XL
171 |
172LL | Self::<()>::SVariant::<()> { v: () };
923072b8
FG
173 | ---- ^^ type argument not allowed
174 | |
175 | not allowed on self type
176 |
177note: `Self` is of type `Enum<T>`
178 --> $DIR/enum-variant-generic-args.rs:7:6
179 |
180LL | enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
181 | ^^^^ `Self` corresponds to this type
182...
183LL | impl<T> Enum<T> {
184 | --------------- `Self` is on type `Enum` in this `impl`
185help: the `Self` type doesn't accept type parameters, use the concrete type's name `Enum` instead if you want to specify its type parameters
186 |
187LL | Enum::<()>::SVariant::<()> { v: () };
188 | ~~~~
0731742a 189
923072b8 190error[E0109]: type arguments are not allowed on this type
dc9dc135 191 --> $DIR/enum-variant-generic-args.rs:34:32
0731742a
XL
192 |
193LL | Self::<()>::SVariant::<()> { v: () };
923072b8
FG
194 | -------- ^^ type argument not allowed
195 | |
196 | not allowed on this type
197 |
198 = note: enum variants can't have type parameters
199help: you might have meant to specity type parameters on enum `Enum`
200 |
201LL - Self::<()>::SVariant::<()> { v: () };
202LL + Enum::<()>::SVariant { v: () };
203 |
0731742a
XL
204
205error[E0308]: mismatched types
dc9dc135 206 --> $DIR/enum-variant-generic-args.rs:34:41
0731742a 207 |
60c5eb7d
XL
208LL | impl<T> Enum<T> {
209 | - this type parameter
210...
0731742a 211LL | Self::<()>::SVariant::<()> { v: () };
60c5eb7d 212 | ^^ expected type parameter `T`, found `()`
0731742a 213 |
60c5eb7d
XL
214 = note: expected type parameter `T`
215 found unit type `()`
0731742a 216
923072b8 217error[E0109]: type arguments are not allowed on this type
dc9dc135
XL
218 --> $DIR/enum-variant-generic-args.rs:41:26
219 |
220LL | Self::UVariant::<()>;
923072b8
FG
221 | -------- ^^ type argument not allowed
222 | |
223 | not allowed on this type
dc9dc135 224
923072b8 225error[E0109]: type arguments are not allowed on self type
dc9dc135
XL
226 --> $DIR/enum-variant-generic-args.rs:43:16
227 |
228LL | Self::<()>::UVariant;
923072b8
FG
229 | ---- ^^ type argument not allowed
230 | |
231 | not allowed on self type
232 |
233note: `Self` is of type `Enum<T>`
234 --> $DIR/enum-variant-generic-args.rs:7:6
235 |
236LL | enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
237 | ^^^^ `Self` corresponds to this type
238...
239LL | impl<T> Enum<T> {
240 | --------------- `Self` is on type `Enum` in this `impl`
241help: the `Self` type doesn't accept type parameters, use the concrete type's name `Enum` instead if you want to specify its type parameters
242 |
243LL | Enum::<()>::UVariant;
244 | ~~~~
dc9dc135 245
923072b8 246error[E0109]: type arguments are not allowed on self type
dc9dc135
XL
247 --> $DIR/enum-variant-generic-args.rs:45:16
248 |
249LL | Self::<()>::UVariant::<()>;
923072b8
FG
250 | ---- ^^ type argument not allowed
251 | |
252 | not allowed on self type
253 |
254note: `Self` is of type `Enum<T>`
255 --> $DIR/enum-variant-generic-args.rs:7:6
256 |
257LL | enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
258 | ^^^^ `Self` corresponds to this type
259...
260LL | impl<T> Enum<T> {
261 | --------------- `Self` is on type `Enum` in this `impl`
262help: the `Self` type doesn't accept type parameters, use the concrete type's name `Enum` instead if you want to specify its type parameters
263 |
264LL | Enum::<()>::UVariant::<()>;
265 | ~~~~
dc9dc135 266
923072b8 267error[E0109]: type arguments are not allowed on this type
dc9dc135
XL
268 --> $DIR/enum-variant-generic-args.rs:45:32
269 |
270LL | Self::<()>::UVariant::<()>;
923072b8
FG
271 | -------- ^^ type argument not allowed
272 | |
273 | not allowed on this type
dc9dc135 274
923072b8 275error[E0109]: type arguments are not allowed on tuple variant `TSVariant`
dc9dc135 276 --> $DIR/enum-variant-generic-args.rs:54:29
0731742a
XL
277 |
278LL | Enum::<()>::TSVariant::<()>(());
923072b8
FG
279 | --------- ^^ type argument not allowed
280 | |
281 | not allowed on tuple variant `TSVariant`
0731742a 282
923072b8 283error[E0109]: type arguments are not allowed on this type
dc9dc135 284 --> $DIR/enum-variant-generic-args.rs:57:24
0731742a
XL
285 |
286LL | Alias::TSVariant::<()>(());
923072b8
FG
287 | --------- ^^ type argument not allowed
288 | |
289 | not allowed on this type
0731742a 290
923072b8 291error[E0109]: type arguments are not allowed on this type
dc9dc135 292 --> $DIR/enum-variant-generic-args.rs:59:30
0731742a
XL
293 |
294LL | Alias::<()>::TSVariant::<()>(());
923072b8
FG
295 | --------- ^^ type argument not allowed
296 | |
297 | not allowed on this type
0731742a 298
923072b8 299error[E0109]: type arguments are not allowed on this type
dc9dc135 300 --> $DIR/enum-variant-generic-args.rs:62:29
0731742a
XL
301 |
302LL | AliasFixed::TSVariant::<()>(());
923072b8
FG
303 | --------- ^^ type argument not allowed
304 | |
305 | not allowed on this type
0731742a 306
17df50a5 307error[E0107]: this type alias takes 0 generic arguments but 1 generic argument was supplied
5869c6ff 308 --> $DIR/enum-variant-generic-args.rs:64:5
0731742a
XL
309 |
310LL | AliasFixed::<()>::TSVariant(());
5869c6ff
XL
311 | ^^^^^^^^^^------ help: remove these generics
312 | |
17df50a5 313 | expected 0 generic arguments
5869c6ff 314 |
17df50a5 315note: type alias defined here, with 0 generic parameters
5869c6ff
XL
316 --> $DIR/enum-variant-generic-args.rs:9:6
317 |
318LL | type AliasFixed = Enum<()>;
319 | ^^^^^^^^^^
0731742a 320
17df50a5 321error[E0107]: this type alias takes 0 generic arguments but 1 generic argument was supplied
5869c6ff 322 --> $DIR/enum-variant-generic-args.rs:66:5
0731742a
XL
323 |
324LL | AliasFixed::<()>::TSVariant::<()>(());
5869c6ff
XL
325 | ^^^^^^^^^^------ help: remove these generics
326 | |
17df50a5 327 | expected 0 generic arguments
5869c6ff 328 |
17df50a5 329note: type alias defined here, with 0 generic parameters
5869c6ff
XL
330 --> $DIR/enum-variant-generic-args.rs:9:6
331 |
332LL | type AliasFixed = Enum<()>;
333 | ^^^^^^^^^^
0731742a 334
923072b8 335error[E0109]: type arguments are not allowed on this type
dc9dc135 336 --> $DIR/enum-variant-generic-args.rs:66:35
0731742a
XL
337 |
338LL | AliasFixed::<()>::TSVariant::<()>(());
923072b8
FG
339 | --------- ^^ type argument not allowed
340 | |
341 | not allowed on this type
0731742a 342
923072b8 343error[E0109]: type arguments are not allowed on variant `SVariant`
dc9dc135 344 --> $DIR/enum-variant-generic-args.rs:72:28
0731742a
XL
345 |
346LL | Enum::<()>::SVariant::<()> { v: () };
923072b8
FG
347 | -------- ^^ type argument not allowed
348 | |
349 | not allowed on variant `SVariant`
350 |
351 = note: enum variants can't have type parameters
0731742a 352
923072b8 353error[E0109]: type arguments are not allowed on this type
dc9dc135 354 --> $DIR/enum-variant-generic-args.rs:75:23
0731742a
XL
355 |
356LL | Alias::SVariant::<()> { v: () };
923072b8
FG
357 | -------- ^^ type argument not allowed
358 | |
359 | not allowed on this type
360 |
361 = note: enum variants can't have type parameters
362help: you might have meant to specity type parameters on enum `Enum`
363 |
364LL - Alias::SVariant::<()> { v: () };
365LL + Alias::<()>::SVariant { v: () };
366 |
0731742a 367
923072b8 368error[E0109]: type arguments are not allowed on this type
dc9dc135 369 --> $DIR/enum-variant-generic-args.rs:77:29
0731742a
XL
370 |
371LL | Alias::<()>::SVariant::<()> { v: () };
923072b8
FG
372 | -------- ^^ type argument not allowed
373 | |
374 | not allowed on this type
375 |
376 = note: enum variants can't have type parameters
377help: you might have meant to specity type parameters on enum `Enum`
378 |
379LL - Alias::<()>::SVariant::<()> { v: () };
380LL + Alias::<()>::SVariant { v: () };
381 |
0731742a 382
923072b8 383error[E0109]: type arguments are not allowed on this type
dc9dc135 384 --> $DIR/enum-variant-generic-args.rs:80:28
0731742a
XL
385 |
386LL | AliasFixed::SVariant::<()> { v: () };
923072b8
FG
387 | -------- ^^ type argument not allowed
388 | |
389 | not allowed on this type
390 |
391 = note: enum variants can't have type parameters
392help: you might have meant to specity type parameters on enum `Enum`
393 |
394LL - AliasFixed::SVariant::<()> { v: () };
395LL + AliasFixed::<()>::SVariant { v: () };
396 |
0731742a 397
17df50a5 398error[E0107]: this type alias takes 0 generic arguments but 1 generic argument was supplied
5869c6ff 399 --> $DIR/enum-variant-generic-args.rs:82:5
0731742a
XL
400 |
401LL | AliasFixed::<()>::SVariant { v: () };
5869c6ff
XL
402 | ^^^^^^^^^^------ help: remove these generics
403 | |
17df50a5 404 | expected 0 generic arguments
5869c6ff 405 |
17df50a5 406note: type alias defined here, with 0 generic parameters
5869c6ff
XL
407 --> $DIR/enum-variant-generic-args.rs:9:6
408 |
409LL | type AliasFixed = Enum<()>;
410 | ^^^^^^^^^^
0731742a 411
17df50a5 412error[E0107]: this type alias takes 0 generic arguments but 1 generic argument was supplied
5869c6ff 413 --> $DIR/enum-variant-generic-args.rs:84:5
0731742a
XL
414 |
415LL | AliasFixed::<()>::SVariant::<()> { v: () };
5869c6ff
XL
416 | ^^^^^^^^^^------ help: remove these generics
417 | |
17df50a5 418 | expected 0 generic arguments
5869c6ff 419 |
17df50a5 420note: type alias defined here, with 0 generic parameters
5869c6ff
XL
421 --> $DIR/enum-variant-generic-args.rs:9:6
422 |
423LL | type AliasFixed = Enum<()>;
424 | ^^^^^^^^^^
0731742a 425
923072b8 426error[E0109]: type arguments are not allowed on this type
dc9dc135 427 --> $DIR/enum-variant-generic-args.rs:84:34
0731742a
XL
428 |
429LL | AliasFixed::<()>::SVariant::<()> { v: () };
923072b8
FG
430 | -------- ^^ type argument not allowed
431 | |
432 | not allowed on this type
433 |
434 = note: enum variants can't have type parameters
435help: you might have meant to specity type parameters on enum `Enum`
436 |
437LL - AliasFixed::<()>::SVariant::<()> { v: () };
438LL + AliasFixed::<()>::SVariant { v: () };
439 |
0731742a 440
923072b8 441error[E0109]: type arguments are not allowed on unit variant `UVariant`
dc9dc135
XL
442 --> $DIR/enum-variant-generic-args.rs:90:28
443 |
444LL | Enum::<()>::UVariant::<()>;
923072b8
FG
445 | -------- ^^ type argument not allowed
446 | |
447 | not allowed on unit variant `UVariant`
dc9dc135 448
923072b8 449error[E0109]: type arguments are not allowed on this type
dc9dc135
XL
450 --> $DIR/enum-variant-generic-args.rs:93:23
451 |
452LL | Alias::UVariant::<()>;
923072b8
FG
453 | -------- ^^ type argument not allowed
454 | |
455 | not allowed on this type
dc9dc135 456
923072b8 457error[E0109]: type arguments are not allowed on this type
dc9dc135
XL
458 --> $DIR/enum-variant-generic-args.rs:95:29
459 |
460LL | Alias::<()>::UVariant::<()>;
923072b8
FG
461 | -------- ^^ type argument not allowed
462 | |
463 | not allowed on this type
dc9dc135 464
923072b8 465error[E0109]: type arguments are not allowed on this type
dc9dc135
XL
466 --> $DIR/enum-variant-generic-args.rs:98:28
467 |
468LL | AliasFixed::UVariant::<()>;
923072b8
FG
469 | -------- ^^ type argument not allowed
470 | |
471 | not allowed on this type
dc9dc135 472
17df50a5 473error[E0107]: this type alias takes 0 generic arguments but 1 generic argument was supplied
5869c6ff 474 --> $DIR/enum-variant-generic-args.rs:100:5
dc9dc135
XL
475 |
476LL | AliasFixed::<()>::UVariant;
5869c6ff
XL
477 | ^^^^^^^^^^------ help: remove these generics
478 | |
17df50a5 479 | expected 0 generic arguments
5869c6ff 480 |
17df50a5 481note: type alias defined here, with 0 generic parameters
5869c6ff
XL
482 --> $DIR/enum-variant-generic-args.rs:9:6
483 |
484LL | type AliasFixed = Enum<()>;
485 | ^^^^^^^^^^
dc9dc135 486
17df50a5 487error[E0107]: this type alias takes 0 generic arguments but 1 generic argument was supplied
5869c6ff 488 --> $DIR/enum-variant-generic-args.rs:102:5
dc9dc135
XL
489 |
490LL | AliasFixed::<()>::UVariant::<()>;
5869c6ff
XL
491 | ^^^^^^^^^^------ help: remove these generics
492 | |
17df50a5 493 | expected 0 generic arguments
5869c6ff 494 |
17df50a5 495note: type alias defined here, with 0 generic parameters
5869c6ff
XL
496 --> $DIR/enum-variant-generic-args.rs:9:6
497 |
498LL | type AliasFixed = Enum<()>;
499 | ^^^^^^^^^^
dc9dc135 500
923072b8 501error[E0109]: type arguments are not allowed on this type
dc9dc135
XL
502 --> $DIR/enum-variant-generic-args.rs:102:34
503 |
504LL | AliasFixed::<()>::UVariant::<()>;
923072b8
FG
505 | -------- ^^ type argument not allowed
506 | |
507 | not allowed on this type
dc9dc135
XL
508
509error: aborting due to 39 previous errors
0731742a 510
48663c56 511Some errors have detailed explanations: E0107, E0109, E0308.
0731742a 512For more information about an error, try `rustc --explain E0107`.