Account for match arms statements without a block #82524
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-parser
Area: The parsing of Rust source code to an AST
D-newcomer-roadblock
Diagnostics: Confusing error or lint; hard to understand for new users.
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.
Given the following code:
The current output is:
The first error is a generic parse error that we could account for. The second is an inference error that would be completely solved if the parse error was recovered more gracefully.
Ideally, for a generic case the output should look like:
while for a case where a single statement is found we could also suggest:
Taken from https://twitter.com/mcclure111/status/1364998004852236289
The text was updated successfully, but these errors were encountered: