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