]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/clone_on_copy.stderr
New upstream version 1.73.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / clone_on_copy.stderr
CommitLineData
f20569fa 1error: using `clone` on type `i32` which implements the `Copy` trait
5099ac24 2 --> $DIR/clone_on_copy.rs:25:5
f20569fa
XL
3 |
4LL | 42.clone();
5 | ^^^^^^^^^^ help: try removing the `clone` call: `42`
6 |
7 = note: `-D clippy::clone-on-copy` implied by `-D warnings`
8
9error: using `clone` on type `i32` which implements the `Copy` trait
5099ac24 10 --> $DIR/clone_on_copy.rs:29:5
f20569fa
XL
11 |
12LL | (&42).clone();
13 | ^^^^^^^^^^^^^ help: try dereferencing it: `*(&42)`
14
15error: using `clone` on type `i32` which implements the `Copy` trait
5099ac24 16 --> $DIR/clone_on_copy.rs:32:5
f20569fa
XL
17 |
18LL | rc.borrow().clone();
19 | ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*rc.borrow()`
20
cdc7bbd5 21error: using `clone` on type `u32` which implements the `Copy` trait
5099ac24 22 --> $DIR/clone_on_copy.rs:35:5
cdc7bbd5
XL
23 |
24LL | x.clone().rotate_left(1);
25 | ^^^^^^^^^ help: try removing the `clone` call: `x`
26
27error: using `clone` on type `i32` which implements the `Copy` trait
5099ac24 28 --> $DIR/clone_on_copy.rs:49:5
cdc7bbd5
XL
29 |
30LL | m!(42).clone();
31 | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `m!(42)`
32
33error: using `clone` on type `[u32; 2]` which implements the `Copy` trait
5099ac24 34 --> $DIR/clone_on_copy.rs:59:5
cdc7bbd5
XL
35 |
36LL | x.clone()[0];
37 | ^^^^^^^^^ help: try dereferencing it: `(*x)`
38
f20569fa 39error: using `clone` on type `char` which implements the `Copy` trait
5099ac24 40 --> $DIR/clone_on_copy.rs:69:14
f20569fa
XL
41 |
42LL | is_ascii('z'.clone());
43 | ^^^^^^^^^^^ help: try removing the `clone` call: `'z'`
44
45error: using `clone` on type `i32` which implements the `Copy` trait
5099ac24 46 --> $DIR/clone_on_copy.rs:73:14
f20569fa
XL
47 |
48LL | vec.push(42.clone());
49 | ^^^^^^^^^^ help: try removing the `clone` call: `42`
50
9c376795 51error: using `clone` on type `Option<i32>` which implements the `Copy` trait
f2b60f7d
FG
52 --> $DIR/clone_on_copy.rs:77:17
53 |
54LL | let value = opt.clone()?; // operator precedence needed (*opt)?
55 | ^^^^^^^^^^^ help: try dereferencing it: `(*opt)`
56
57error: aborting due to 9 previous errors
f20569fa 58