-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Parse and reject "typescript-style" anonymous enums #100741
Comments
@rustbot claim |
Teach parser to understand fake anonymous enum syntax Parse `Ty | OtherTy` in function argument and return types. Parse type ascription in top level patterns. Minimally address rust-lang#100741.
Teach parser to understand fake anonymous enum syntax Parse `Ty | OtherTy` in function argument and return types. Parse type ascription in top level patterns. Minimally address rust-lang#100741.
Teach parser to understand fake anonymous enum syntax Parse `Ty | OtherTy` in function argument and return types. Parse type ascription in top level patterns. Minimally address rust-lang#100741.
Note: this had to be reverted because of the ambiguities. A new implementation has to be careful to only recover once invalid syntax has been discovered and not recover on the happy path. |
To expand on the above: types can syntactically go in the same place closure and or binop expressions can, and macros that use |
Teach parser to understand fake anonymous enum syntax Parse `Ty | OtherTy` in function argument and return types. Parse type ascription in top level patterns. Minimally address rust-lang#100741.
I love the idea! It's related to this RFC right? |
Given
we currently point at the
|
and complain about it not being expected.Ideally, this should parse and explicitly state that anonymous enums are not supported, and provide a structured suggestion for
At least, we should emit a note suggesting the above in text without a structured suggestion (which will be easier to produce).
The text was updated successfully, but these errors were encountered: