Warn on accidental copying of arrays #1474
Labels
A-lint
Area: New lints
E-medium
Call for participation: Medium difficulty level problem and requires some initial experience.
L-correctness
Lint: Belongs in the correctness lint group
T-middle
Type: Probably requires verifiying types
The code below compiles correctly, but makes no sense at all. I think this violates the principle of least surprise (we had a nice discussion about it on #rust). See if you can spot the error ;)
Would it be possible to add a lint for this? Just warning that a captured array of
Clone
elements will be copied and not moved.Credits go to @arianvp for coming up with the code (and needing 5 days to discover why it was wrong)
The text was updated successfully, but these errors were encountered: