1 error: using `clone` on a `Copy` type
2 --> $DIR/unnecessary_clone.rs:16:5
5 | ^^^^^^^^^^ help: try removing the `clone` call: `42`
7 = note: `-D clone-on-copy` implied by `-D warnings`
9 error: using `clone` on a `Copy` type
10 --> $DIR/unnecessary_clone.rs:20:5
13 | ^^^^^^^^^^^^^ help: try dereferencing it: `*(&42)`
15 error: using '.clone()' on a ref-counted pointer
16 --> $DIR/unnecessary_clone.rs:30:5
19 | ^^^^^^^^^^ help: try this: `Rc::<bool>::clone(&rc)`
21 = note: `-D clone-on-ref-ptr` implied by `-D warnings`
23 error: using '.clone()' on a ref-counted pointer
24 --> $DIR/unnecessary_clone.rs:33:5
27 | ^^^^^^^^^^^ help: try this: `Arc::<bool>::clone(&arc)`
29 error: using '.clone()' on a ref-counted pointer
30 --> $DIR/unnecessary_clone.rs:36:5
33 | ^^^^^^^^^^^^^^ help: try this: `Weak::<bool>::clone(&rcweak)`
35 error: using '.clone()' on a ref-counted pointer
36 --> $DIR/unnecessary_clone.rs:39:5
38 39 | arc_weak.clone();
39 | ^^^^^^^^^^^^^^^^ help: try this: `Weak::<bool>::clone(&arc_weak)`
41 error: using '.clone()' on a ref-counted pointer
42 --> $DIR/unnecessary_clone.rs:43:29
44 43 | let _: Arc<SomeTrait> = x.clone();
45 | ^^^^^^^^^ help: try this: `Arc::<SomeImpl>::clone(&x)`
47 error: using `clone` on a `Copy` type
48 --> $DIR/unnecessary_clone.rs:47:5
51 | ^^^^^^^^^ help: try removing the `clone` call: `t`
53 error: using `clone` on a `Copy` type
54 --> $DIR/unnecessary_clone.rs:49:5
57 | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `Some(t)`
59 error: using `clone` on a double-reference; this will copy the reference instead of cloning the inner type
60 --> $DIR/unnecessary_clone.rs:55:22
62 55 | let z: &Vec<_> = y.clone();
65 = note: `-D clone-double-ref` implied by `-D warnings`
66 help: try dereferencing it
68 55 | let z: &Vec<_> = &(*y).clone();
70 help: or try being explicit about what type to clone
72 55 | let z: &Vec<_> = &std::vec::Vec<i32>::clone(y);
73 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75 error: called `cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
76 --> $DIR/unnecessary_clone.rs:62:27
78 62 | let v2 : Vec<isize> = v.iter().cloned().collect();
79 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
81 = note: `-D iter-cloned-collect` implied by `-D warnings`