-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.
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).
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.