Parse error on let followed by a block should suggest likely alternatives if-let or let-else #107806
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-parser
Area: The parsing of Rust source code to an AST
D-lack-of-suggestion
Diagnostics: Adding a (structured) suggestion would increase the quality of the diagnostic.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
Its pretty natural at times to try to flip code from a
let
to anif let
, but the resulting compiler parsing error is not as helpful as it could be.Other cases
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: