-
Notifications
You must be signed in to change notification settings - Fork 13.3k
supplying generic args to variant and enum results in weird error #93993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
At the very least the wording should be |
|
estebank
added a commit
to estebank/rust
that referenced
this issue
Dec 31, 2024
``` error[E0109]: type arguments are not allowed on tuple variant `TSVariant` --> $DIR/enum-variant-generic-args.rs:54:29 | LL | TSVariant::<()>(()); | --------- ^^ type argument not allowed | | | not allowed on tuple variant `TSVariant` | = note: type arguments are not allowed for enum variants; specify them on the enum itself ``` Fix rust-lang#93993.
estebank
added a commit
to estebank/rust
that referenced
this issue
Dec 31, 2024
``` error[E0109]: type arguments are not allowed on tuple variant `TSVariant` --> $DIR/enum-variant-generic-args.rs:54:29 | LL | TSVariant::<()>(()); | --------- ^^ type argument not allowed | | | not allowed on tuple variant `TSVariant` | = note: type arguments are not allowed for enum variants; specify them on the enum itself ``` Fix rust-lang#93993.
estebank
added a commit
to estebank/rust
that referenced
this issue
Jan 30, 2025
…variant ``` error[E0109]: type arguments are not allowed on tuple variant `TSVariant` --> $DIR/enum-variant-generic-args.rs:54:29 | LL | Enum::<()>::TSVariant::<()>(()); | --------- ^^ type argument not allowed | | | not allowed on tuple variant `TSVariant` | = 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::<()>(()); | LL - Enum::<()>::TSVariant::<()>(()); LL + Enum::<()>::TSVariant(()); | ``` Fix rust-lang#93993.
estebank
added a commit
to estebank/rust
that referenced
this issue
Feb 4, 2025
…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 rust-lang#93993.
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Feb 12, 2025
Explain that in paths generics can't be set on both the enum and the variant ``` error[E0109]: type arguments are not allowed on tuple variant `TSVariant` --> $DIR/enum-variant-generic-args.rs:54:29 | LL | Enum::<()>::TSVariant::<()>(()); | --------- ^^ type argument not allowed | | | not allowed on tuple variant `TSVariant` | = 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::<()>(()); | LL - Enum::<()>::TSVariant::<()>(()); LL + Enum::<()>::TSVariant(()); | ``` Fix rust-lang#93993.
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Feb 12, 2025
Explain that in paths generics can't be set on both the enum and the variant ``` error[E0109]: type arguments are not allowed on tuple variant `TSVariant` --> $DIR/enum-variant-generic-args.rs:54:29 | LL | Enum::<()>::TSVariant::<()>(()); | --------- ^^ type argument not allowed | | | not allowed on tuple variant `TSVariant` | = 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::<()>(()); | LL - Enum::<()>::TSVariant::<()>(()); LL + Enum::<()>::TSVariant(()); | ``` Fix rust-lang#93993.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Feb 12, 2025
Rollup merge of rust-lang#134981 - estebank:issue-93993, r=BoxyUwU Explain that in paths generics can't be set on both the enum and the variant ``` error[E0109]: type arguments are not allowed on tuple variant `TSVariant` --> $DIR/enum-variant-generic-args.rs:54:29 | LL | Enum::<()>::TSVariant::<()>(()); | --------- ^^ type argument not allowed | | | not allowed on tuple variant `TSVariant` | = 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::<()>(()); | LL - Enum::<()>::TSVariant::<()>(()); LL + Enum::<()>::TSVariant(()); | ``` Fix rust-lang#93993.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
results in
this error is far from ideal. we ideally mention that variants may only have generic arguments if their enum doesn't have any. not sure what's the best wording here or how to best achieve this
The text was updated successfully, but these errors were encountered: