@@ -85,16 +85,46 @@ help: try dereferencing it
8585 |
8686LL | let z: &Vec<_> = &(*y).clone();
8787 | ^^^^^^^^^^^^^
88- help: or try being explicit about what type to clone
88+ help: or try being explicit if you are sure, that you want to clone a reference
8989 |
90- LL | let z: &Vec<_> = &std::vec::Vec<i32>::clone(y);
91- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
90+ LL | let z: &Vec<_> = < &std::vec::Vec<i32> >::clone(y);
91+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9292
9393error: using `clone` on a `Copy` type
9494 --> $DIR/unnecessary_clone.rs:109:20
9595 |
9696LL | let _: E = a.clone();
9797 | ^^^^^^^^^ help: try dereferencing it: `*****a`
9898
99- error: aborting due to 14 previous errors
99+ error: using `clone` on a double-reference; this will copy the reference instead of cloning the inner type
100+ --> $DIR/unnecessary_clone.rs:114:22
101+ |
102+ LL | let _ = &mut encoded.clone();
103+ | ^^^^^^^^^^^^^^^
104+ |
105+ help: try dereferencing it
106+ |
107+ LL | let _ = &mut &(*encoded).clone();
108+ | ^^^^^^^^^^^^^^^^^^^
109+ help: or try being explicit if you are sure, that you want to clone a reference
110+ |
111+ LL | let _ = &mut <&[u8]>::clone(encoded);
112+ | ^^^^^^^^^^^^^^^^^^^^^^^
113+
114+ error: using `clone` on a double-reference; this will copy the reference instead of cloning the inner type
115+ --> $DIR/unnecessary_clone.rs:115:18
116+ |
117+ LL | let _ = &encoded.clone();
118+ | ^^^^^^^^^^^^^^^
119+ |
120+ help: try dereferencing it
121+ |
122+ LL | let _ = &&(*encoded).clone();
123+ | ^^^^^^^^^^^^^^^^^^^
124+ help: or try being explicit if you are sure, that you want to clone a reference
125+ |
126+ LL | let _ = &<&[u8]>::clone(encoded);
127+ | ^^^^^^^^^^^^^^^^^^^^^^^
128+
129+ error: aborting due to 16 previous errors
100130
0 commit comments