Skip to content

Commit 9427e03

Browse files
committed
Fix clone_on_copy test
1 parent 1853f8b commit 9427e03

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

tests/ui/clone_on_copy.fixed

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
clippy::redundant_clone,
66
clippy::deref_addrof,
77
clippy::no_effect,
8-
clippy::unnecessary_operation
8+
clippy::unnecessary_operation,
9+
clippy::vec_init_then_push
910
)]
1011

1112
use std::cell::RefCell;

tests/ui/clone_on_copy.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
clippy::redundant_clone,
66
clippy::deref_addrof,
77
clippy::no_effect,
8-
clippy::unnecessary_operation
8+
clippy::unnecessary_operation,
9+
clippy::vec_init_then_push
910
)]
1011

1112
use std::cell::RefCell;

tests/ui/clone_on_copy.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
error: using `clone` on type `i32` which implements the `Copy` trait
2-
--> $DIR/clone_on_copy.rs:22:5
2+
--> $DIR/clone_on_copy.rs:23:5
33
|
44
LL | 42.clone();
55
| ^^^^^^^^^^ help: try removing the `clone` call: `42`
66
|
77
= note: `-D clippy::clone-on-copy` implied by `-D warnings`
88

99
error: using `clone` on type `i32` which implements the `Copy` trait
10-
--> $DIR/clone_on_copy.rs:26:5
10+
--> $DIR/clone_on_copy.rs:27:5
1111
|
1212
LL | (&42).clone();
1313
| ^^^^^^^^^^^^^ help: try dereferencing it: `*(&42)`
1414

1515
error: using `clone` on type `i32` which implements the `Copy` trait
16-
--> $DIR/clone_on_copy.rs:29:5
16+
--> $DIR/clone_on_copy.rs:30:5
1717
|
1818
LL | rc.borrow().clone();
1919
| ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*rc.borrow()`
2020

2121
error: using `clone` on type `char` which implements the `Copy` trait
22-
--> $DIR/clone_on_copy.rs:35:14
22+
--> $DIR/clone_on_copy.rs:36:14
2323
|
2424
LL | is_ascii('z'.clone());
2525
| ^^^^^^^^^^^ help: try removing the `clone` call: `'z'`
2626

2727
error: using `clone` on type `i32` which implements the `Copy` trait
28-
--> $DIR/clone_on_copy.rs:39:14
28+
--> $DIR/clone_on_copy.rs:40:14
2929
|
3030
LL | vec.push(42.clone());
3131
| ^^^^^^^^^^ help: try removing the `clone` call: `42`

0 commit comments

Comments
 (0)