blob: 0198f8e42430c2f4f1156b2864099a9a4a8a1580 [file]
error: using `clone` on type `i32` which implements the `Copy` trait
--> tests/ui/clone_on_copy.rs:13:5
|
LL | 42.clone();
| ^^^^^^^^^^ help: try removing the `clone` call: `42`
|
= note: `-D clippy::clone-on-copy` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::clone_on_copy)]`
error: using `clone` on type `i32` which implements the `Copy` trait
--> tests/ui/clone_on_copy.rs:18:5
|
LL | (&42).clone();
| ^^^^^^^^^^^^^ help: try dereferencing it: `*(&42)`
error: using `clone` on type `i32` which implements the `Copy` trait
--> tests/ui/clone_on_copy.rs:22:5
|
LL | rc.borrow().clone();
| ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*rc.borrow()`
error: using `clone` on type `u32` which implements the `Copy` trait
--> tests/ui/clone_on_copy.rs:26:5
|
LL | x.clone().rotate_left(1);
| ^^^^^^^^^ help: try removing the `clone` call: `x`
error: using `clone` on type `i32` which implements the `Copy` trait
--> tests/ui/clone_on_copy.rs:41:5
|
LL | m!(42).clone();
| ^^^^^^^^^^^^^^ help: try removing the `clone` call: `m!(42)`
error: using `clone` on type `[u32; 2]` which implements the `Copy` trait
--> tests/ui/clone_on_copy.rs:52:5
|
LL | x.clone()[0];
| ^^^^^^^^^ help: try dereferencing it: `(*x)`
error: using `clone` on type `E` which implements the `Copy` trait
--> tests/ui/clone_on_copy.rs:91:20
|
LL | let _: E = a.clone();
| ^^^^^^^^^ help: try dereferencing it: `*****a`
error: using `clone` on type `char` which implements the `Copy` trait
--> tests/ui/clone_on_copy.rs:106:14
|
LL | is_ascii('z'.clone());
| ^^^^^^^^^^^ help: try removing the `clone` call: `'z'`
error: using `clone` on type `i32` which implements the `Copy` trait
--> tests/ui/clone_on_copy.rs:113:14
|
LL | vec.push(42.clone());
| ^^^^^^^^^^ help: try removing the `clone` call: `42`
error: using `clone` on type `Option<i32>` which implements the `Copy` trait
--> tests/ui/clone_on_copy.rs:119:17
|
LL | let value = opt.clone()?; // operator precedence needed (*opt)?
| ^^^^^^^^^^^ help: try dereferencing it: `(*opt)`
error: aborting due to 10 previous errors