-
-
Notifications
You must be signed in to change notification settings - Fork 15k
let else: wrong diagnostic span on return type mismatch #96961
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsF-let_elseIssues related to let-else statements (RFC 3137)Issues related to let-else statements (RFC 3137)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.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsF-let_elseIssues related to let-else statements (RFC 3137)Issues related to let-else statements (RFC 3137)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.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The following code [playground]
fails to build with the following:
note the span points to just the
let .. else, but there's nothing wrong with it, the problem is the function return type doesn't match. I'd have expected the error to look the same as if thelet elsewasn't there, which is: