rustc suggests to use impl trait in closure parameter which doesn't work #138932
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 start with some obviously invalid code,
rustc
makes two suggestions - pass&dyn Trait
by reference - this works and useimpl Trait
which doesn't work.Usually following compiler suggestions you get closer to having working code, but here this leads to a dead end.
Other cases
Rust Version
Anything else?
Nightly makes a similar suggestion, also broken.
The text was updated successfully, but these errors were encountered: