1 error: using `clone` on a `Copy` type
2 --> $DIR/unnecessary_clone.rs:21:5
5 | ^^^^^^^^^^ help: try removing the `clone` call: `42`
7 = note: `-D clippy::clone-on-copy` implied by `-D warnings`
9 error: using `clone` on a `Copy` type
10 --> $DIR/unnecessary_clone.rs:25:5
13 | ^^^^^^^^^^^^^ help: try dereferencing it: `*(&42)`
15 error: using `clone` on a `Copy` type
16 --> $DIR/unnecessary_clone.rs:28:5
18 LL | rc.borrow().clone();
19 | ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*rc.borrow()`
21 error: using `clone` on a `Copy` type
22 --> $DIR/unnecessary_clone.rs:34:14
24 LL | is_ascii('z'.clone());
25 | ^^^^^^^^^^^ help: try removing the `clone` call: `'z'`
27 error: using `clone` on a `Copy` type
28 --> $DIR/unnecessary_clone.rs:38:14
30 LL | vec.push(42.clone());
31 | ^^^^^^^^^^ help: try removing the `clone` call: `42`
33 error: using `.clone()` on a ref-counted pointer
34 --> $DIR/unnecessary_clone.rs:48:5
37 | ^^^^^^^^^^ help: try this: `Rc::<bool>::clone(&rc)`
39 = note: `-D clippy::clone-on-ref-ptr` implied by `-D warnings`
41 error: using `.clone()` on a ref-counted pointer
42 --> $DIR/unnecessary_clone.rs:51:5
45 | ^^^^^^^^^^^ help: try this: `Arc::<bool>::clone(&arc)`
47 error: using `.clone()` on a ref-counted pointer
48 --> $DIR/unnecessary_clone.rs:54:5
51 | ^^^^^^^^^^^^^^ help: try this: `Weak::<bool>::clone(&rcweak)`
53 error: using `.clone()` on a ref-counted pointer
54 --> $DIR/unnecessary_clone.rs:57:5
56 LL | arc_weak.clone();
57 | ^^^^^^^^^^^^^^^^ help: try this: `Weak::<bool>::clone(&arc_weak)`
59 error: using `.clone()` on a ref-counted pointer
60 --> $DIR/unnecessary_clone.rs:61:33
62 LL | let _: Arc<dyn SomeTrait> = x.clone();
63 | ^^^^^^^^^ help: try this: `Arc::<SomeImpl>::clone(&x)`
65 error: using `clone` on a `Copy` type
66 --> $DIR/unnecessary_clone.rs:65:5
69 | ^^^^^^^^^ help: try removing the `clone` call: `t`
71 error: using `clone` on a `Copy` type
72 --> $DIR/unnecessary_clone.rs:67:5
75 | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `Some(t)`
77 error: using `clone` on a double-reference; this will copy the reference instead of cloning the inner type
78 --> $DIR/unnecessary_clone.rs:73:22
80 LL | let z: &Vec<_> = y.clone();
83 = note: `#[deny(clippy::clone_double_ref)]` on by default
84 help: try dereferencing it
86 LL | let z: &Vec<_> = &(*y).clone();
88 help: or try being explicit about what type to clone
90 LL | let z: &Vec<_> = &std::vec::Vec<i32>::clone(y);
91 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93 error: using `clone` on a `Copy` type
94 --> $DIR/unnecessary_clone.rs:109:20
96 LL | let _: E = a.clone();
97 | ^^^^^^^^^ help: try dereferencing it: `*****a`
99 error: aborting due to 14 previous errors