-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Suggest ;
on parse error when applicable
#87197
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
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Just a guess: could this be addressed with another
|
I think we would need to answer this question: why is the logic here not handling the cases we want to handle? rust/compiler/rustc_parse/src/parser/diagnostics.rs Lines 1184 to 1202 in 3a24abd
|
This seems to be on track given the clue "probe that the current token and maybe limited lookahead confirm that what comes next could be a valid statement on its own"... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
That is a great question: as the code is written it looks like it should work. I don't know why it isn't triggering :( It might be that rust/compiler/rustc_parse/src/parser/diagnostics.rs Lines 213 to 217 in 3a24abd
|
I'd like to give this a try. @rustbot claim |
Given the following code:
The current output is:
We should detect cases where a semicolon would be appropriate (probe that the current token and maybe limited lookahead confirm that what comes next could be a valid statement on its own) and suggest a semicolon. If there is a missing
}
, we already suggest that it might belong there. We might want to silence one or the other depending on whether the current token might be starting a statement or an item (let
vsstruct
, etc.).The text was updated successfully, but these errors were encountered: