Fix clone_on_copy test
This commit is contained in:
parent
1853f8b228
commit
9427e0356b
@ -5,7 +5,8 @@
|
|||||||
clippy::redundant_clone,
|
clippy::redundant_clone,
|
||||||
clippy::deref_addrof,
|
clippy::deref_addrof,
|
||||||
clippy::no_effect,
|
clippy::no_effect,
|
||||||
clippy::unnecessary_operation
|
clippy::unnecessary_operation,
|
||||||
|
clippy::vec_init_then_push
|
||||||
)]
|
)]
|
||||||
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
|
@ -5,7 +5,8 @@
|
|||||||
clippy::redundant_clone,
|
clippy::redundant_clone,
|
||||||
clippy::deref_addrof,
|
clippy::deref_addrof,
|
||||||
clippy::no_effect,
|
clippy::no_effect,
|
||||||
clippy::unnecessary_operation
|
clippy::unnecessary_operation,
|
||||||
|
clippy::vec_init_then_push
|
||||||
)]
|
)]
|
||||||
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
error: using `clone` on type `i32` which implements the `Copy` trait
|
error: using `clone` on type `i32` which implements the `Copy` trait
|
||||||
--> $DIR/clone_on_copy.rs:22:5
|
--> $DIR/clone_on_copy.rs:23:5
|
||||||
|
|
|
|
||||||
LL | 42.clone();
|
LL | 42.clone();
|
||||||
| ^^^^^^^^^^ help: try removing the `clone` call: `42`
|
| ^^^^^^^^^^ help: try removing the `clone` call: `42`
|
||||||
@ -7,25 +7,25 @@ LL | 42.clone();
|
|||||||
= note: `-D clippy::clone-on-copy` implied by `-D warnings`
|
= note: `-D clippy::clone-on-copy` implied by `-D warnings`
|
||||||
|
|
||||||
error: using `clone` on type `i32` which implements the `Copy` trait
|
error: using `clone` on type `i32` which implements the `Copy` trait
|
||||||
--> $DIR/clone_on_copy.rs:26:5
|
--> $DIR/clone_on_copy.rs:27:5
|
||||||
|
|
|
|
||||||
LL | (&42).clone();
|
LL | (&42).clone();
|
||||||
| ^^^^^^^^^^^^^ help: try dereferencing it: `*(&42)`
|
| ^^^^^^^^^^^^^ help: try dereferencing it: `*(&42)`
|
||||||
|
|
||||||
error: using `clone` on type `i32` which implements the `Copy` trait
|
error: using `clone` on type `i32` which implements the `Copy` trait
|
||||||
--> $DIR/clone_on_copy.rs:29:5
|
--> $DIR/clone_on_copy.rs:30:5
|
||||||
|
|
|
|
||||||
LL | rc.borrow().clone();
|
LL | rc.borrow().clone();
|
||||||
| ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*rc.borrow()`
|
| ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*rc.borrow()`
|
||||||
|
|
||||||
error: using `clone` on type `char` which implements the `Copy` trait
|
error: using `clone` on type `char` which implements the `Copy` trait
|
||||||
--> $DIR/clone_on_copy.rs:35:14
|
--> $DIR/clone_on_copy.rs:36:14
|
||||||
|
|
|
|
||||||
LL | is_ascii('z'.clone());
|
LL | is_ascii('z'.clone());
|
||||||
| ^^^^^^^^^^^ help: try removing the `clone` call: `'z'`
|
| ^^^^^^^^^^^ help: try removing the `clone` call: `'z'`
|
||||||
|
|
||||||
error: using `clone` on type `i32` which implements the `Copy` trait
|
error: using `clone` on type `i32` which implements the `Copy` trait
|
||||||
--> $DIR/clone_on_copy.rs:39:14
|
--> $DIR/clone_on_copy.rs:40:14
|
||||||
|
|
|
|
||||||
LL | vec.push(42.clone());
|
LL | vec.push(42.clone());
|
||||||
| ^^^^^^^^^^ help: try removing the `clone` call: `42`
|
| ^^^^^^^^^^ help: try removing the `clone` call: `42`
|
||||||
|
Loading…
Reference in New Issue
Block a user