-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Suboptimal error in case of duplicate ,
in struct constructor
#50974
Comments
The parser gives up on parsing this error here: It could try to continue parsing if it encounters some simple tokens and a look ahead verifies that the next field is well formed. It could also recover from missing commas as well. |
Missing commas have been fixed mere moments ago: #50914 (comment) |
@PramodBisht #50914 only addresses the case where a comma is missing in a struct definition.
Should only have the following output:
Note that there should be no error about missing fields, as the struct definition parser should recover after the parse error and include the following fields. |
@estebank Ah, right. Got it now :) |
…truct constructor
@lambtowolf : I was already working on that, feel free to snatch it from me if I don't raise PR in next few days :P |
Issue rust-lang#50974 : Suboptimal error in case of duplicate `,` in struct constructor Fixes rust-lang#50974
…truct constructor
results in
we may want to add a parser recovery that just reports the error, eats the comma and continues parsing as normally
The text was updated successfully, but these errors were encountered: