Better error message when forgetting the right operand in an if condition #30035
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-parser
Area: The parsing of Rust source code to an AST
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
WG-diagnostics
Working group: Diagnostics
Hello.
The following code gives an error message that could be improved:
It gives the following error:
This is because the compiler sees the right operand as a block expression, and is looking for the condition body, something like:
while we most probably mean to write something like:
So, it would be nice to improve this error message.
The text was updated successfully, but these errors were encountered: