Expand description

The suspicious_double_ref_op lint checks for usage of .clone()/.borrow()/.deref() on an &&T when T: !Deref/Borrow/Clone, which means the call will return the inner &T, instead of performing the operation on the underlying T and can be confusing.


struct Foo;
let foo = &&Foo;
let clone: &Foo = foo.clone();



Since Foo doesn’t implement Clone, running .clone() only dereferences the double reference, instead of cloning the inner type which should be what was intended.