Closed
Description
#59288 introduces some duplicates in diagnostics in if-without-else-as-fn-expr.rs
. Specifically, you have e.g.:
error[E0308]: mismatched types
--> $DIR/if-without-else-as-fn-expr.rs:35:20
|
LL | let x: usize = if let 0 = 1 {
| ____________________^
LL | | return 3;
LL | | };
| |_____^ expected usize, found ()
|
= note: expected type `usize`
found type `()`
error[E0317]: if may be missing an else clause
--> $DIR/if-without-else-as-fn-expr.rs:35:20
|
LL | let x: usize = if let 0 = 1 {
| _________-__________^
| | |
| | expected because of this assignment
LL | | return 3;
LL | | };
| |_____^ expected usize, found ()
|
= note: expected type `usize`
found type `()`
= note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type
We want to get rid of the first one since the second is better...
...but this is not done in #59288 since I wanted to avoid too many temporary changes for diagnostics that may get obsoleted quickly.