@@ -45,62 +45,16 @@ LL | Some(t).clone();
4545 | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `Some(t)`
4646
4747error: using `clone` on type `E` which implements the `Copy` trait
48- --> $DIR/unnecessary_clone.rs:84 :20
48+ --> $DIR/unnecessary_clone.rs:76 :20
4949 |
5050LL | let _: E = a.clone();
5151 | ^^^^^^^^^ help: try dereferencing it: `*****a`
5252
5353error: using `.clone()` on a ref-counted pointer
54- --> $DIR/unnecessary_clone.rs:108 :14
54+ --> $DIR/unnecessary_clone.rs:95 :14
5555 |
5656LL | Some(try_opt!(Some(rc)).clone())
5757 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `Rc::<u8>::clone(&try_opt!(Some(rc)))`
5858
59- error: using `clone` on a double-reference, which copies the reference of type `std::vec::Vec<i32>` instead of cloning the inner type
60- --> $DIR/unnecessary_clone.rs:48:22
61- |
62- LL | let z: &Vec<_> = y.clone();
63- | ^^^^^^^^^
64- |
65- = note: `-D clone-double-ref` implied by `-D warnings`
66- help: try dereferencing it
67- |
68- LL | let z: &Vec<_> = &(*y).clone();
69- | +++ ~~~~~~~~~
70- help: or try being explicit if you are sure, that you want to clone a reference
71- |
72- LL | let z: &Vec<_> = <&std::vec::Vec<i32>>::clone(y);
73- | +++++++++++++++++++++++++++++ ~
74-
75- error: using `clone` on a double-reference, which copies the reference of type `[u8]` instead of cloning the inner type
76- --> $DIR/unnecessary_clone.rs:89:22
77- |
78- LL | let _ = &mut encoded.clone();
79- | ^^^^^^^^^^^^^^^
80- |
81- help: try dereferencing it
82- |
83- LL | let _ = &mut &(*encoded).clone();
84- | +++ ~~~~~~~~~
85- help: or try being explicit if you are sure, that you want to clone a reference
86- |
87- LL | let _ = &mut <&[u8]>::clone(encoded);
88- | +++++++++++++++ ~
89-
90- error: using `clone` on a double-reference, which copies the reference of type `[u8]` instead of cloning the inner type
91- --> $DIR/unnecessary_clone.rs:90:18
92- |
93- LL | let _ = &encoded.clone();
94- | ^^^^^^^^^^^^^^^
95- |
96- help: try dereferencing it
97- |
98- LL | let _ = &&(*encoded).clone();
99- | +++ ~~~~~~~~~
100- help: or try being explicit if you are sure, that you want to clone a reference
101- |
102- LL | let _ = &<&[u8]>::clone(encoded);
103- | +++++++++++++++ ~
104-
105- error: aborting due to 12 previous errors
59+ error: aborting due to 9 previous errors
10660
0 commit comments