-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Let chain error message with || is confusing and verbose #140263
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.F-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.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.F-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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Code
Current output
Desired output
Rationale and extra context
The current error message has several confusing factors:
expected expression, found `let` statementwhich is confusing. I suppose this is technically correct (letis not allowed in anifwith a||), but muddles the problem. There's also the confusion of using the term`let` statement`, where the term "statement"is confusing here.only supported directly in conditions of `if` and `while` expressionsis confusing, since we are in anifexpression.note: `||` operators are not supported in let chain expressionsshows the actual problem, but it is lost in a sea of other text.Other cases
Rust Version
Anything else?
No response