let else: wrong diagnostic span on return type mismatch #96961
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
F-let_else
Issues related to let-else statements (RFC 3137)
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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 else
wasn't there, which is:The text was updated successfully, but these errors were encountered: