-
Couldn't load subscription status.
- Fork 13.9k
Description
Certain types could start out as having contents that move and then switch to only copyable field, or could just be missing #[deriving(Copy)] initially.
If Copy is implemented after that type has been used in a large codebase (there's a few cases in rustc itself), there will likely be many .clone() calls around, and finding which ones belong to the type could be tedious.
A lint would ease this work, by suggesting the replacement of an unnecessary x.clone() call with a dereference (if x is a reference to the type being cloned - could use the autoderef count here) or nothing at all (since using a Copy lvalue as an rvalue will just copy it).