mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 21:53:23 +00:00
b2cb6ffbe3
changelog: clone_on_copy: show the type in the lint message
34 lines
1.1 KiB
Text
34 lines
1.1 KiB
Text
error: using `clone` on type `i32` which implements the `Copy` trait
|
|
--> $DIR/clone_on_copy.rs:22:5
|
|
|
|
|
LL | 42.clone();
|
|
| ^^^^^^^^^^ help: try removing the `clone` call: `42`
|
|
|
|
|
= note: `-D clippy::clone-on-copy` implied by `-D warnings`
|
|
|
|
error: using `clone` on type `i32` which implements the `Copy` trait
|
|
--> $DIR/clone_on_copy.rs:26:5
|
|
|
|
|
LL | (&42).clone();
|
|
| ^^^^^^^^^^^^^ help: try dereferencing it: `*(&42)`
|
|
|
|
error: using `clone` on type `i32` which implements the `Copy` trait
|
|
--> $DIR/clone_on_copy.rs:29:5
|
|
|
|
|
LL | rc.borrow().clone();
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*rc.borrow()`
|
|
|
|
error: using `clone` on type `char` which implements the `Copy` trait
|
|
--> $DIR/clone_on_copy.rs:35:14
|
|
|
|
|
LL | is_ascii('z'.clone());
|
|
| ^^^^^^^^^^^ help: try removing the `clone` call: `'z'`
|
|
|
|
error: using `clone` on type `i32` which implements the `Copy` trait
|
|
--> $DIR/clone_on_copy.rs:39:14
|
|
|
|
|
LL | vec.push(42.clone());
|
|
| ^^^^^^^^^^ help: try removing the `clone` call: `42`
|
|
|
|
error: aborting due to 5 previous errors
|
|
|