Confusing error message when matching on an unnecessarily-unwrapped value #63082
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Consider this code (playground):
This looks like perfectly reasonable code, but upon further inspection, you can see an
.unwrap()
as a leftover from refactoring. However, Rust chooses a quite confusing way of pointing this out:As far as I am aware, there is no way to solve this problem with just a type annotation.
The text was updated successfully, but these errors were encountered: