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
11
-
--> $DIR/noop-method-call.rs:17:21
11
+
--> $DIR/noop-method-call.rs:21:21
12
12
|
13
13
LL | let _ = &encoded.clone();
14
14
| ^^^^^^^^ help: remove this redundant call
15
15
|
16
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
18
warning: call to `.clone()` on a reference in this situation does nothing
19
-
--> $DIR/noop-method-call.rs:23:71
19
+
--> $DIR/noop-method-call.rs:27:71
20
20
|
21
21
LL | let non_clone_type_ref_clone: &PlainType<u32> = non_clone_type_ref.clone();
22
22
| ^^^^^^^^
@@ -34,7 +34,7 @@ LL | struct PlainType<T>(T);
34
34
|
35
35
36
36
warning: call to `.deref()` on a reference in this situation does nothing
37
-
--> $DIR/noop-method-call.rs:31:63
37
+
--> $DIR/noop-method-call.rs:35:63
38
38
|
39
39
LL | let non_deref_type_deref: &PlainType<u32> = non_deref_type.deref();
40
40
| ^^^^^^^^
@@ -52,7 +52,7 @@ LL | struct PlainType<T>(T);
52
52
|
53
53
54
54
warning: call to `.borrow()` on a reference in this situation does nothing
55
-
--> $DIR/noop-method-call.rs:35:66
55
+
--> $DIR/noop-method-call.rs:39:66
56
56
|
57
57
LL | let non_borrow_type_borrow: &PlainType<u32> = non_borrow_type.borrow();
58
58
| ^^^^^^^^^
@@ -70,7 +70,7 @@ LL | struct PlainType<T>(T);
70
70
|
71
71
72
72
warning: call to `.clone()` on a reference in this situation does nothing
73
-
--> $DIR/noop-method-call.rs:44:19
73
+
--> $DIR/noop-method-call.rs:48:19
74
74
|
75
75
LL | non_clone_type.clone();
76
76
| ^^^^^^^^
@@ -88,7 +88,7 @@ LL | struct PlainType<T>(T);
88
88
|
89
89
90
90
warning: call to `.clone()` on a reference in this situation does nothing
91
-
--> $DIR/noop-method-call.rs:49:19
91
+
--> $DIR/noop-method-call.rs:53:19
92
92
|
93
93
LL | non_clone_type.clone();
94
94
| ^^^^^^^^
@@ -105,5 +105,57 @@ LL + #[derive(Clone)]
105
105
LL | struct PlainType<T>(T);
106
106
|
107
107
108
-
warning: 7 warnings emitted
108
+
warning: call to `.clone()` on a reference in this situation does nothing
109
+
--> $DIR/noop-method-call.rs:70:6
110
+
|
111
+
LL | v.clone();
112
+
| ^^^^^^^^ help: remove this redundant call
113
+
|
114
+
= note: the type `non_clone_types::NotClone` does not implement `Clone`, so calling `clone` on `&non_clone_types::NotClone` copies the reference, which does not do anything and can be removed
115
+
116
+
warning: call to `.clone()` on a reference in this situation does nothing
117
+
--> $DIR/noop-method-call.rs:75:6
118
+
|
119
+
LL | v.clone();
120
+
| ^^^^^^^^
121
+
|
122
+
= note: the type `non_clone_types::ConditionalClone<PlainType<u32>>` does not implement `Clone`, so calling `clone` on `&non_clone_types::ConditionalClone<PlainType<u32>>` copies the reference, which does not do anything and can be removed
123
+
help: remove this redundant call
124
+
|
125
+
LL - v.clone();
126
+
LL + v;
127
+
|
128
+
help: if you meant to clone `non_clone_types::ConditionalClone<PlainType<u32>>`, implement `Clone` for it
129
+
|
130
+
LL + #[derive(Clone)]
131
+
LL | struct PlainType<T>(T);
132
+
|
133
+
134
+
warning: call to `.clone()` on a reference in this situation does nothing
135
+
--> $DIR/noop-method-call.rs:80:6
136
+
|
137
+
LL | v.clone();
138
+
| ^^^^^^^^ help: remove this redundant call
139
+
|
140
+
= note: the type `non_clone_types::ConditionalClone<non_clone_types::NotClone>` does not implement `Clone`, so calling `clone` on `&non_clone_types::ConditionalClone<non_clone_types::NotClone>` copies the reference, which does not do anything and can be removed
141
+
142
+
warning: call to `.clone()` on a reference in this situation does nothing
143
+
--> $DIR/noop-method-call.rs:89:6
144
+
|
145
+
LL | v.clone();
146
+
| ^^^^^^^^
147
+
|
148
+
= note: the type `non_clone_types::DifferentlyConditionalClone<PlainType<u8>>` does not implement `Clone`, so calling `clone` on `&non_clone_types::DifferentlyConditionalClone<PlainType<u8>>` copies the reference, which does not do anything and can be removed
149
+
help: remove this redundant call
150
+
|
151
+
LL - v.clone();
152
+
LL + v;
153
+
|
154
+
help: if you meant to clone `non_clone_types::DifferentlyConditionalClone<PlainType<u8>>`, implement `Clone` for it
0 commit comments