Skip to content
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

Improve recovery diagnostic for for ( $pat in $expr ) $block #63113

Closed
Centril opened this issue Jul 29, 2019 · 1 comment · Fixed by #86422
Closed

Improve recovery diagnostic for for ( $pat in $expr ) $block #63113

Centril opened this issue Jul 29, 2019 · 1 comment · Fixed by #86422
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` C-enhancement Category: An issue proposing an enhancement or a PR with one. D-papercut Diagnostics: An error or lint that needs small tweaks. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Centril
Copy link
Contributor

Centril commented Jul 29, 2019

Roughly according to #62928 (comment).

cc @estebank

@Centril Centril added C-enhancement Category: An issue proposing an enhancement or a PR with one. 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. A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` labels Jul 29, 2019
@Centril
Copy link
Contributor Author

Centril commented Jul 29, 2019

Some notes:

We have two errors pointing at the problem here (the prior "in not expected" error, but it's ok emitting both for now)

I think this is not worth fixing as it would require hacks deep in the general sequence parser.

Suggestions that have very subtle changes sometimes make people not pay attention to the text, in this case people might not realize the lack of parenthesis in the suggested code.

We should try to still have MachineApplicable suggestions; @estebank notes that there are special purpose methods for doing that.

error: unnecessary parenthesis surroundinig for loop head

"Unnecessary" is semantically misleading here as this is a hard error, not a lint.

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 A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` C-enhancement Category: An issue proposing an enhancement or a PR with one. D-papercut Diagnostics: An error or lint that needs small tweaks. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants