|
1 | 1 | warning: call to `.clone()` on a reference in this situation does nothing
|
2 |
| - --> $DIR/noop-method-call.rs:15:71 |
| 2 | + --> $DIR/noop-method-call.rs:15:25 |
3 | 3 | |
|
4 |
| -LL | let non_clone_type_ref_clone: &PlainType<u32> = non_clone_type_ref.clone(); |
5 |
| - | ^^^^^^^^ unnecessary method call |
| 4 | +LL | let _ = &mut encoded.clone(); |
| 5 | + | ^^^^^^^^ help: remove this redundant call |
6 | 6 | |
|
7 |
| - = note: the type `PlainType<u32>` does not implement `Clone`, so calling `clone` on `&PlainType<u32>` copies the reference, which does not do anything and can be removed |
| 7 | + = note: the type `[u8]` does not implement `Clone`, so calling `clone` on `&[u8]` copies the reference, which does not do anything and can be removed |
8 | 8 | = note: `#[warn(noop_method_call)]` on by default
|
9 | 9 |
|
10 |
| -warning: using `.clone()` on a double reference, which returns `&CloneType<u32>` instead of cloning the inner type |
11 |
| - --> $DIR/noop-method-call.rs:22:63 |
| 10 | +warning: call to `.clone()` on a reference in this situation does nothing |
| 11 | + --> $DIR/noop-method-call.rs:17:21 |
12 | 12 | |
|
13 |
| -LL | let clone_type_ref_clone: &CloneType<u32> = clone_type_ref.clone(); |
14 |
| - | ^^^^^^^^ |
| 13 | +LL | let _ = &encoded.clone(); |
| 14 | + | ^^^^^^^^ help: remove this redundant call |
15 | 15 | |
|
16 |
| - = note: `#[warn(suspicious_double_ref_op)]` on by default |
| 16 | + = note: the type `[u8]` does not implement `Clone`, so calling `clone` on `&[u8]` copies the reference, which does not do anything and can be removed |
17 | 17 |
|
18 |
| -warning: call to `.deref()` on a reference in this situation does nothing |
19 |
| - --> $DIR/noop-method-call.rs:26:63 |
| 18 | +warning: call to `.clone()` on a reference in this situation does nothing |
| 19 | + --> $DIR/noop-method-call.rs:23:71 |
20 | 20 | |
|
21 |
| -LL | let non_deref_type_deref: &PlainType<u32> = non_deref_type.deref(); |
22 |
| - | ^^^^^^^^ unnecessary method call |
| 21 | +LL | let non_clone_type_ref_clone: &PlainType<u32> = non_clone_type_ref.clone(); |
| 22 | + | ^^^^^^^^ help: remove this redundant call |
23 | 23 | |
|
24 |
| - = note: the type `PlainType<u32>` does not implement `Deref`, so calling `deref` on `&PlainType<u32>` copies the reference, which does not do anything and can be removed |
| 24 | + = note: the type `PlainType<u32>` does not implement `Clone`, so calling `clone` on `&PlainType<u32>` copies the reference, which does not do anything and can be removed |
25 | 25 |
|
26 |
| -warning: using `.deref()` on a double reference, which returns `&PlainType<u32>` instead of dereferencing the inner type |
27 |
| - --> $DIR/noop-method-call.rs:30:63 |
| 26 | +warning: call to `.deref()` on a reference in this situation does nothing |
| 27 | + --> $DIR/noop-method-call.rs:31:63 |
28 | 28 | |
|
29 | 29 | LL | let non_deref_type_deref: &PlainType<u32> = non_deref_type.deref();
|
30 |
| - | ^^^^^^^^ |
| 30 | + | ^^^^^^^^ help: remove this redundant call |
| 31 | + | |
| 32 | + = note: the type `PlainType<u32>` does not implement `Deref`, so calling `deref` on `&PlainType<u32>` copies the reference, which does not do anything and can be removed |
31 | 33 |
|
32 | 34 | warning: call to `.borrow()` on a reference in this situation does nothing
|
33 |
| - --> $DIR/noop-method-call.rs:34:66 |
| 35 | + --> $DIR/noop-method-call.rs:35:66 |
34 | 36 | |
|
35 | 37 | LL | let non_borrow_type_borrow: &PlainType<u32> = non_borrow_type.borrow();
|
36 |
| - | ^^^^^^^^^ unnecessary method call |
| 38 | + | ^^^^^^^^^ help: remove this redundant call |
37 | 39 | |
|
38 | 40 | = note: the type `PlainType<u32>` does not implement `Borrow`, so calling `borrow` on `&PlainType<u32>` copies the reference, which does not do anything and can be removed
|
39 | 41 |
|
40 |
| -warning: using `.clone()` on a double reference, which returns `&str` instead of cloning the inner type |
41 |
| - --> $DIR/noop-method-call.rs:42:44 |
42 |
| - | |
43 |
| -LL | let _v: Vec<&str> = xs.iter().map(|x| x.clone()).collect(); // could use `*x` instead |
44 |
| - | ^^^^^^^^ |
45 |
| - |
46 | 42 | warning: call to `.clone()` on a reference in this situation does nothing
|
47 |
| - --> $DIR/noop-method-call.rs:47:19 |
| 43 | + --> $DIR/noop-method-call.rs:44:19 |
48 | 44 | |
|
49 | 45 | LL | non_clone_type.clone();
|
50 |
| - | ^^^^^^^^ unnecessary method call |
| 46 | + | ^^^^^^^^ help: remove this redundant call |
51 | 47 | |
|
52 | 48 | = note: the type `PlainType<T>` does not implement `Clone`, so calling `clone` on `&PlainType<T>` copies the reference, which does not do anything and can be removed
|
53 | 49 |
|
54 | 50 | warning: call to `.clone()` on a reference in this situation does nothing
|
55 |
| - --> $DIR/noop-method-call.rs:52:19 |
| 51 | + --> $DIR/noop-method-call.rs:49:19 |
56 | 52 | |
|
57 | 53 | LL | non_clone_type.clone();
|
58 |
| - | ^^^^^^^^ unnecessary method call |
| 54 | + | ^^^^^^^^ help: remove this redundant call |
59 | 55 | |
|
60 | 56 | = note: the type `PlainType<u32>` does not implement `Clone`, so calling `clone` on `&PlainType<u32>` copies the reference, which does not do anything and can be removed
|
61 | 57 |
|
62 |
| -warning: 8 warnings emitted |
| 58 | +warning: 7 warnings emitted |
63 | 59 |
|
0 commit comments