Option/Result get wrong diagnostic for closure as map_or first argument #102408
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.
If
map_or
's first arguments is given a closure, the diagnostic now is as below, which is not right:https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=a24f43e57b31d21c67716fd23888a507
The current output is:
Ideally, we should suggest to use
map_or_else
.Maybe related to #102320, which I was working on, but the above diagnostic message for arguments is not right, may be another issue.
The text was updated successfully, but these errors were encountered: