-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsF-let_chains`#![feature(let_chains)]``#![feature(let_chains)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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.
estebank
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsF-let_chains`#![feature(let_chains)]``#![feature(let_chains)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.