summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/clone_on_copy.stderr
blob: 42ae227777c7082a20849bfb489b2332850a6ac9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
error: using `clone` on type `i32` which implements the `Copy` trait
  --> $DIR/clone_on_copy.rs:25: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:29: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:32:5
   |
LL |     rc.borrow().clone();
   |     ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*rc.borrow()`

error: using `clone` on type `u32` which implements the `Copy` trait
  --> $DIR/clone_on_copy.rs:35: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
  --> $DIR/clone_on_copy.rs:49: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
  --> $DIR/clone_on_copy.rs:59:5
   |
LL |     x.clone()[0];
   |     ^^^^^^^^^ help: try dereferencing it: `(*x)`

error: using `clone` on type `char` which implements the `Copy` trait
  --> $DIR/clone_on_copy.rs:69: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:73:14
   |
LL |     vec.push(42.clone());
   |              ^^^^^^^^^^ help: try removing the `clone` call: `42`

error: using `clone` on type `std::option::Option<i32>` which implements the `Copy` trait
  --> $DIR/clone_on_copy.rs:77:17
   |
LL |     let value = opt.clone()?; // operator precedence needed (*opt)?
   |                 ^^^^^^^^^^^ help: try dereferencing it: `(*opt)`

error: aborting due to 9 previous errors