When FnMut
or Fn
closure is moved and then used, the compiler should suggest borrowing it instead
#90828
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.
Given the following code: (playground)
The current output is:
While suggestions make the code compile, they restrict the arguments. This can be avoided by borrowing functions instead.
Ideally, the output should look like this:
For the record, here is an example found "in the wild" where I noticed the problem: (playground)
The text was updated successfully, but these errors were encountered: