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