1
1
error: using `clone` on type `i32` which implements the `Copy` trait
2
- --> tests/ui/clone_on_copy.rs:23 :5
2
+ --> tests/ui/clone_on_copy.rs:14 :5
3
3
|
4
4
LL | 42.clone();
5
5
| ^^^^^^^^^^ help: try removing the `clone` call: `42`
@@ -8,52 +8,58 @@ LL | 42.clone();
8
8
= help: to override `-D warnings` add `#[allow(clippy::clone_on_copy)]`
9
9
10
10
error: using `clone` on type `i32` which implements the `Copy` trait
11
- --> tests/ui/clone_on_copy.rs:28 :5
11
+ --> tests/ui/clone_on_copy.rs:19 :5
12
12
|
13
13
LL | (&42).clone();
14
14
| ^^^^^^^^^^^^^ help: try dereferencing it: `*(&42)`
15
15
16
16
error: using `clone` on type `i32` which implements the `Copy` trait
17
- --> tests/ui/clone_on_copy.rs:32 :5
17
+ --> tests/ui/clone_on_copy.rs:23 :5
18
18
|
19
19
LL | rc.borrow().clone();
20
20
| ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*rc.borrow()`
21
21
22
22
error: using `clone` on type `u32` which implements the `Copy` trait
23
- --> tests/ui/clone_on_copy.rs:36 :5
23
+ --> tests/ui/clone_on_copy.rs:27 :5
24
24
|
25
25
LL | x.clone().rotate_left(1);
26
26
| ^^^^^^^^^ help: try removing the `clone` call: `x`
27
27
28
28
error: using `clone` on type `i32` which implements the `Copy` trait
29
- --> tests/ui/clone_on_copy.rs:51 :5
29
+ --> tests/ui/clone_on_copy.rs:42 :5
30
30
|
31
31
LL | m!(42).clone();
32
32
| ^^^^^^^^^^^^^^ help: try removing the `clone` call: `m!(42)`
33
33
34
34
error: using `clone` on type `[u32; 2]` which implements the `Copy` trait
35
- --> tests/ui/clone_on_copy.rs:62 :5
35
+ --> tests/ui/clone_on_copy.rs:53 :5
36
36
|
37
37
LL | x.clone()[0];
38
38
| ^^^^^^^^^ help: try dereferencing it: `(*x)`
39
39
40
+ error: using `clone` on type `E` which implements the `Copy` trait
41
+ --> tests/ui/clone_on_copy.rs:92:20
42
+ |
43
+ LL | let _: E = a.clone();
44
+ | ^^^^^^^^^ help: try dereferencing it: `*****a`
45
+
40
46
error: using `clone` on type `char` which implements the `Copy` trait
41
- --> tests/ui/clone_on_copy.rs:73 :14
47
+ --> tests/ui/clone_on_copy.rs:107 :14
42
48
|
43
49
LL | is_ascii('z'.clone());
44
50
| ^^^^^^^^^^^ help: try removing the `clone` call: `'z'`
45
51
46
52
error: using `clone` on type `i32` which implements the `Copy` trait
47
- --> tests/ui/clone_on_copy.rs:78 :14
53
+ --> tests/ui/clone_on_copy.rs:114 :14
48
54
|
49
55
LL | vec.push(42.clone());
50
56
| ^^^^^^^^^^ help: try removing the `clone` call: `42`
51
57
52
58
error: using `clone` on type `Option<i32>` which implements the `Copy` trait
53
- --> tests/ui/clone_on_copy.rs:83 :17
59
+ --> tests/ui/clone_on_copy.rs:120 :17
54
60
|
55
61
LL | let value = opt.clone()?; // operator precedence needed (*opt)?
56
62
| ^^^^^^^^^^^ help: try dereferencing it: `(*opt)`
57
63
58
- error: aborting due to 9 previous errors
64
+ error: aborting due to 10 previous errors
59
65
0 commit comments