1 error: using `.clone()` on a ref-counted pointer
2 --> $DIR/unnecessary_clone.rs:23:5
5 | ^^^^^^^^^^ help: try this: `Rc::<bool>::clone(&rc)`
7 = note: `-D clippy::clone-on-ref-ptr` implied by `-D warnings`
9 error: using `.clone()` on a ref-counted pointer
10 --> $DIR/unnecessary_clone.rs:26:5
13 | ^^^^^^^^^^^ help: try this: `Arc::<bool>::clone(&arc)`
15 error: using `.clone()` on a ref-counted pointer
16 --> $DIR/unnecessary_clone.rs:29:5
19 | ^^^^^^^^^^^^^^ help: try this: `Weak::<bool>::clone(&rcweak)`
21 error: using `.clone()` on a ref-counted pointer
22 --> $DIR/unnecessary_clone.rs:32:5
24 LL | arc_weak.clone();
25 | ^^^^^^^^^^^^^^^^ help: try this: `Weak::<bool>::clone(&arc_weak)`
27 error: non-binding let on a type that implements `Drop`
28 --> $DIR/unnecessary_clone.rs:36:5
30 LL | let _: Arc<dyn SomeTrait> = x.clone();
31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33 = note: `#[deny(clippy::let_underscore_drop)]` on by default
34 = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
36 error: using `.clone()` on a ref-counted pointer
37 --> $DIR/unnecessary_clone.rs:36:33
39 LL | let _: Arc<dyn SomeTrait> = x.clone();
40 | ^^^^^^^^^ help: try this: `Arc::<SomeImpl>::clone(&x)`
42 error: using `clone` on a `Copy` type
43 --> $DIR/unnecessary_clone.rs:40:5
46 | ^^^^^^^^^ help: try removing the `clone` call: `t`
48 = note: `-D clippy::clone-on-copy` implied by `-D warnings`
50 error: using `clone` on a `Copy` type
51 --> $DIR/unnecessary_clone.rs:42:5
54 | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `Some(t)`
56 error: using `clone` on a double-reference; this will copy the reference instead of cloning the inner type
57 --> $DIR/unnecessary_clone.rs:48:22
59 LL | let z: &Vec<_> = y.clone();
62 = note: `#[deny(clippy::clone_double_ref)]` on by default
63 help: try dereferencing it
65 LL | let z: &Vec<_> = &(*y).clone();
67 help: or try being explicit if you are sure, that you want to clone a reference
69 LL | let z: &Vec<_> = <&std::vec::Vec<i32>>::clone(y);
70 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72 error: using `clone` on a `Copy` type
73 --> $DIR/unnecessary_clone.rs:84:20
75 LL | let _: E = a.clone();
76 | ^^^^^^^^^ help: try dereferencing it: `*****a`
78 error: using `clone` on a double-reference; this will copy the reference instead of cloning the inner type
79 --> $DIR/unnecessary_clone.rs:89:22
81 LL | let _ = &mut encoded.clone();
84 help: try dereferencing it
86 LL | let _ = &mut &(*encoded).clone();
88 help: or try being explicit if you are sure, that you want to clone a reference
90 LL | let _ = &mut <&[u8]>::clone(encoded);
91 | ^^^^^^^^^^^^^^^^^^^^^^^
93 error: using `clone` on a double-reference; this will copy the reference instead of cloning the inner type
94 --> $DIR/unnecessary_clone.rs:90:18
96 LL | let _ = &encoded.clone();
99 help: try dereferencing it
101 LL | let _ = &&(*encoded).clone();
102 | ^^^^^^^^^^^^^^^^^^^
103 help: or try being explicit if you are sure, that you want to clone a reference
105 LL | let _ = &<&[u8]>::clone(encoded);
106 | ^^^^^^^^^^^^^^^^^^^^^^^
108 error: using `.clone()` on a ref-counted pointer
109 --> $DIR/unnecessary_clone.rs:108:14
111 LL | Some(try_opt!(Some(rc)).clone())
112 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `Rc::<u8>::clone(&try_opt!(Some(rc)))`
114 error: aborting due to 13 previous errors