Lint calling mem::swap
on a reference
#1968
Labels
A-lint
Area: New lints
good-first-issue
These issues are a good way to get started with Clippy
L-correctness
Lint: Belongs in the correctness lint group
S-needs-discussion
Status: Needs further discussion before merging or work can be started
T-middle
Type: Probably requires verifiying types
It is possible to accidentally swap references instead of the data itself, just like it is possible to call
mem::drop
on a reference. It may be useful in some cases to swap references to something like slices, but the lint could be disabled in those cases or just be allow by default.The text was updated successfully, but these errors were encountered: