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: using `.clone()` on a ref-counted pointer
28 --> $DIR/unnecessary_clone.rs:36:33
30 LL | let _: Arc<dyn SomeTrait> = x.clone();
31 | ^^^^^^^^^ help: try this: `Arc::<SomeImpl>::clone(&x)`
33 error: using `clone` on type `T` which implements the `Copy` trait
34 --> $DIR/unnecessary_clone.rs:40:5
37 | ^^^^^^^^^ help: try removing the `clone` call: `t`
39 = note: `-D clippy::clone-on-copy` implied by `-D warnings`
41 error: using `clone` on type `std::option::Option<T>` which implements the `Copy` trait
42 --> $DIR/unnecessary_clone.rs:42:5
45 | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `Some(t)`
47 error: using `clone` on a double-reference; this will copy the reference of type `&std::vec::Vec<i32>` instead of cloning the inner type
48 --> $DIR/unnecessary_clone.rs:48:22
50 LL | let z: &Vec<_> = y.clone();
53 = note: `#[deny(clippy::clone_double_ref)]` on by default
54 help: try dereferencing it
56 LL | let z: &Vec<_> = &(*y).clone();
58 help: or try being explicit if you are sure, that you want to clone a reference
60 LL | let z: &Vec<_> = <&std::vec::Vec<i32>>::clone(y);
61 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63 error: using `clone` on type `many_derefs::E` which implements the `Copy` trait
64 --> $DIR/unnecessary_clone.rs:84:20
66 LL | let _: E = a.clone();
67 | ^^^^^^^^^ help: try dereferencing it: `*****a`
69 error: using `clone` on a double-reference; this will copy the reference of type `&[u8]` instead of cloning the inner type
70 --> $DIR/unnecessary_clone.rs:89:22
72 LL | let _ = &mut encoded.clone();
75 help: try dereferencing it
77 LL | let _ = &mut &(*encoded).clone();
79 help: or try being explicit if you are sure, that you want to clone a reference
81 LL | let _ = &mut <&[u8]>::clone(encoded);
82 | ^^^^^^^^^^^^^^^^^^^^^^^
84 error: using `clone` on a double-reference; this will copy the reference of type `&[u8]` instead of cloning the inner type
85 --> $DIR/unnecessary_clone.rs:90:18
87 LL | let _ = &encoded.clone();
90 help: try dereferencing it
92 LL | let _ = &&(*encoded).clone();
94 help: or try being explicit if you are sure, that you want to clone a reference
96 LL | let _ = &<&[u8]>::clone(encoded);
97 | ^^^^^^^^^^^^^^^^^^^^^^^
99 error: using `.clone()` on a ref-counted pointer
100 --> $DIR/unnecessary_clone.rs:108:14
102 LL | Some(try_opt!(Some(rc)).clone())
103 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `Rc::<u8>::clone(&try_opt!(Some(rc)))`
105 error: aborting due to 12 previous errors