Adds an additional hint to failures where we encounter an else keyword while we're parsing an if-let block. This is likely that the user has accidentally mixed if-let and let...else together.
20 lines
474 B
Plaintext
20 lines
474 B
Plaintext
error: this `if` expression is missing a block after the condition
|
|
--> $DIR/accidental-if.rs:3:5
|
|
|
|
|
LL | if let Some(y) = x else {
|
|
| ^^
|
|
|
|
|
help: add a block here
|
|
--> $DIR/accidental-if.rs:3:23
|
|
|
|
|
LL | if let Some(y) = x else {
|
|
| ^
|
|
help: remove the `if` if you meant to write a `let...else` statement
|
|
--> $DIR/accidental-if.rs:3:5
|
|
|
|
|
LL | if let Some(y) = x else {
|
|
| ^^
|
|
|
|
error: aborting due to previous error
|
|
|