Add clearer error message when mistakenly using ok_or
instead of ok_or_else
and equivalent method
#119765
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
We could use the fact that the found type is a closure to detect the user probably wanted to use the
*_else
variant of the method.Other cases
No response
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: