Give a "modifying moved binding" or "unread value" warning in move-closures #37707
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
Take a look at this logically wrong example:
It would be best if the compiler points out that "updating
x
inside the closure will not have an external effect." Though, I would be happy if the compiler at least pointed out that "the modified value in the new bindingx
is never read."The text was updated successfully, but these errors were encountered: