|
1 | 1 | warning: call to `.clone()` on a reference in this situation does nothing
|
2 |
| - --> $DIR/noop-method-call.rs:24:35 |
| 2 | + --> $DIR/noop-method-call.rs:12:74 |
3 | 3 | |
|
4 |
| -LL | let foo_clone: &Foo<u32> = foo.clone(); |
5 |
| - | ^^^^^^^^ unnecessary method call |
| 4 | +LL | let non_clone_type_ref_clone: &NonCloneType<u32> = non_clone_type_ref.clone(); |
| 5 | + | ^^^^^^^^ unnecessary method call |
6 | 6 | |
|
7 | 7 | = note: `#[warn(noop_method_call)]` on by default
|
8 |
| - = note: the type `&Foo<u32>` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed |
9 |
| - |
10 |
| -warning: call to `.deref()` on a reference in this situation does nothing |
11 |
| - --> $DIR/noop-method-call.rs:31:44 |
12 |
| - | |
13 |
| -LL | let derefed: &DerefExample<u32> = deref.deref(); |
14 |
| - | ^^^^^^^^ unnecessary method call |
15 |
| - | |
16 |
| - = note: the type `&DerefExample<u32>` which `deref` is being called on is the same as the type returned from `deref`, so the method call does not do anything and can be removed |
17 |
| - |
18 |
| -warning: call to `.borrow()` on a reference in this situation does nothing |
19 |
| - --> $DIR/noop-method-call.rs:38:32 |
20 |
| - | |
21 |
| -LL | let borrowed: &Foo<u32> = a.borrow(); |
22 |
| - | ^^^^^^^^^ unnecessary method call |
23 |
| - | |
24 |
| - = note: the type `&Foo<u32>` which `borrow` is being called on is the same as the type returned from `borrow`, so the method call does not do anything and can be removed |
| 8 | + = note: the type `&NonCloneType<u32>` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed |
25 | 9 |
|
26 | 10 | warning: call to `.clone()` on a reference in this situation does nothing
|
27 |
| - --> $DIR/noop-method-call.rs:50:8 |
| 11 | + --> $DIR/noop-method-call.rs:32:19 |
28 | 12 | |
|
29 |
| -LL | foo.clone(); |
30 |
| - | ^^^^^^^^ unnecessary method call |
| 13 | +LL | non_clone_type.clone(); |
| 14 | + | ^^^^^^^^ unnecessary method call |
31 | 15 | |
|
32 |
| - = note: the type `&Foo<u32>` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed |
| 16 | + = note: the type `&NonCloneType<u32>` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed |
33 | 17 |
|
34 |
| -warning: 4 warnings emitted |
| 18 | +warning: 2 warnings emitted |
35 | 19 |
|
0 commit comments