Use of moved value error in the for
iterator could give a hint about borrowing
#25534
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
WG-diagnostics
Working group: Diagnostics
currently gives:
Of course, we all know that
for i in &a
etc. is correct here, but this is not very obvious to beginners. We may want to give a contextual hint for "use of moved value" errors among others---probably as a second note following the original move.(Feel free to make this a metabug if there are other such examples.)
The text was updated successfully, but these errors were encountered: