You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Explain that in paths generics can't be set on both the enum and the variant
```
error[E0109]: type arguments are not allowed on enum `Enum` and tuple variant `TSVariant`
--> $DIR/enum-variant-generic-args.rs:54:12
|
LL | Enum::<()>::TSVariant::<()>(());
| ---- ^^ --------- ^^ type argument not allowed
| | |
| | not allowed on tuple variant `TSVariant`
| not allowed on enum `Enum`
|
= note: generic arguments are not allowed on both an enum and its variant's path segments simultaneously; they are only valid in one place or the other
help: remove the generics arguments from one of the path segments
|
LL - Enum::<()>::TSVariant::<()>(());
LL + Enum::<()>::TSVariant(());
|
```
Fix#93993.
error[E0109]: type arguments are not allowed on tuple variant `TSVariant`
276
-
--> $DIR/enum-variant-generic-args.rs:54:29
275
+
error[E0109]: type arguments are not allowed on enum `Enum` and tuple variant `TSVariant`
276
+
--> $DIR/enum-variant-generic-args.rs:54:12
277
277
|
278
278
LL | Enum::<()>::TSVariant::<()>(());
279
-
| --------- ^^ type argument not allowed
280
-
| |
281
-
| not allowed on tuple variant `TSVariant`
279
+
| ---- ^^ --------- ^^ type argument not allowed
280
+
| | |
281
+
| | not allowed on tuple variant `TSVariant`
282
+
| not allowed on enum `Enum`
283
+
|
284
+
= note: generic arguments are not allowed on both an enum and its variant's path segments simultaneously; they are only valid in one place or the other
285
+
help: remove the generics arguments from one of the path segments
286
+
|
287
+
LL - Enum::<()>::TSVariant::<()>(());
288
+
LL + Enum::<()>::TSVariant(());
289
+
|
282
290
283
291
error[E0109]: type arguments are not allowed on this type
error[E0109]: type arguments are not allowed on variant `SVariant`
344
-
--> $DIR/enum-variant-generic-args.rs:72:28
351
+
error[E0109]: type arguments are not allowed on enum `Enum` and variant `SVariant`
352
+
--> $DIR/enum-variant-generic-args.rs:72:12
345
353
|
346
354
LL | Enum::<()>::SVariant::<()> { v: () };
347
-
| -------- ^^ type argument not allowed
348
-
| |
349
-
| not allowed on variant `SVariant`
355
+
| ---- ^^ -------- ^^ type argument not allowed
356
+
| | |
357
+
| | not allowed on variant `SVariant`
358
+
| not allowed on enum `Enum`
359
+
|
360
+
= note: generic arguments are not allowed on both an enum and its variant's path segments simultaneously; they are only valid in one place or the other
361
+
help: remove the generics arguments from one of the path segments
362
+
|
363
+
LL - Enum::<()>::SVariant::<()> { v: () };
364
+
LL + Enum::<()>::SVariant { v: () };
350
365
|
351
-
= note: enum variants can't have type parameters
352
366
353
367
error[E0109]: type arguments are not allowed on this type
error[E0109]: type arguments are not allowed on unit variant `UVariant`
442
-
--> $DIR/enum-variant-generic-args.rs:90:28
455
+
error[E0109]: type arguments are not allowed on enum `Enum` and unit variant `UVariant`
456
+
--> $DIR/enum-variant-generic-args.rs:90:12
443
457
|
444
458
LL | Enum::<()>::UVariant::<()>;
445
-
| -------- ^^ type argument not allowed
446
-
| |
447
-
| not allowed on unit variant `UVariant`
459
+
| ---- ^^ -------- ^^ type argument not allowed
460
+
| | |
461
+
| | not allowed on unit variant `UVariant`
462
+
| not allowed on enum `Enum`
463
+
|
464
+
= note: generic arguments are not allowed on both an enum and its variant's path segments simultaneously; they are only valid in one place or the other
465
+
help: remove the generics arguments from one of the path segments
466
+
|
467
+
LL - Enum::<()>::UVariant::<()>;
468
+
LL + Enum::<()>::UVariant;
469
+
|
448
470
449
471
error[E0109]: type arguments are not allowed on this type
0 commit comments