You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
warning: call to `.clone()` on a reference in this situation does nothing
2
-
--> $DIR/noop-method-call.rs:12:74
2
+
--> $DIR/noop-method-call.rs:16:71
3
3
|
4
-
LL | let non_clone_type_ref_clone: &NonCloneType<u32> = non_clone_type_ref.clone();
5
-
| ^^^^^^^^ unnecessary method call
4
+
LL | let non_clone_type_ref_clone: &PlainType<u32> = non_clone_type_ref.clone();
5
+
| ^^^^^^^^ unnecessary method call
6
6
|
7
-
= note: `#[warn(noop_method_call)]` on by default
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
7
+
note: the lint level is defined here
8
+
--> $DIR/noop-method-call.rs:4:9
9
+
|
10
+
LL | #![warn(noop_method_call)]
11
+
| ^^^^^^^^^^^^^^^^
12
+
= note: the type `&PlainType<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
13
+
14
+
warning: call to `.deref()` on a reference in this situation does nothing
15
+
--> $DIR/noop-method-call.rs:28:63
16
+
|
17
+
LL | let non_deref_type_deref: &PlainType<u32> = non_deref_type.deref();
18
+
| ^^^^^^^^ unnecessary method call
19
+
|
20
+
= note: the type `&PlainType<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
21
+
22
+
warning: call to `.borrow()` on a reference in this situation does nothing
23
+
--> $DIR/noop-method-call.rs:36:66
24
+
|
25
+
LL | let non_borrow_type_borrow: &PlainType<u32> = non_borrow_type.borrow();
26
+
| ^^^^^^^^^ unnecessary method call
27
+
|
28
+
= note: the type `&PlainType<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
9
29
10
30
warning: call to `.clone()` on a reference in this situation does nothing
11
-
--> $DIR/noop-method-call.rs:32:19
31
+
--> $DIR/noop-method-call.rs:52:19
12
32
|
13
33
LL | non_clone_type.clone();
14
34
| ^^^^^^^^ unnecessary method call
15
35
|
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
36
+
= note: the type `&PlainType<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
0 commit comments