@@ -17,43 +17,78 @@ error: this argument is passed by value, but not consumed in the function body
17
17
--> tests/ui/needless_pass_by_value.rs:35:22
18
18
|
19
19
LL | fn bar(x: String, y: Wrapper) {
20
- | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
20
+ | ^^^^^^^
21
+ |
22
+ help: consider taking a reference instead
23
+ |
24
+ LL | fn bar(x: String, y: &Wrapper) {
25
+ | +
21
26
22
27
error: this argument is passed by value, but not consumed in the function body
23
28
--> tests/ui/needless_pass_by_value.rs:44:71
24
29
|
25
30
LL | fn test_borrow_trait<T: Borrow<str>, U: AsRef<str>, V>(t: T, u: U, v: V) {
26
- | ^ help: consider taking a reference instead: `&V`
31
+ | ^
32
+ |
33
+ help: consider taking a reference instead
34
+ |
35
+ LL | fn test_borrow_trait<T: Borrow<str>, U: AsRef<str>, V>(t: T, u: U, v: &V) {
36
+ | +
27
37
28
38
error: this argument is passed by value, but not consumed in the function body
29
39
--> tests/ui/needless_pass_by_value.rs:58:18
30
40
|
31
41
LL | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
32
- | ^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `Option<Option<&String>>`
42
+ | ^^^^^^^^^^^^^^^^^^^^^^
43
+ |
44
+ help: consider taking a reference instead
45
+ |
46
+ LL | fn test_match(x: Option<Option<&String>>, y: Option<Option<String>>) {
47
+ | +
33
48
34
49
error: this argument is passed by value, but not consumed in the function body
35
50
--> tests/ui/needless_pass_by_value.rs:73:24
36
51
|
37
52
LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
38
- | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
53
+ | ^^^^^^^
54
+ |
55
+ help: consider taking a reference instead
56
+ |
57
+ LL | fn test_destructure(x: &Wrapper, y: Wrapper, z: Wrapper) {
58
+ | +
39
59
40
60
error: this argument is passed by value, but not consumed in the function body
41
61
--> tests/ui/needless_pass_by_value.rs:73:36
42
62
|
43
63
LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
44
- | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
64
+ | ^^^^^^^
65
+ |
66
+ help: consider taking a reference instead
67
+ |
68
+ LL | fn test_destructure(x: Wrapper, y: &Wrapper, z: Wrapper) {
69
+ | +
45
70
46
71
error: this argument is passed by value, but not consumed in the function body
47
72
--> tests/ui/needless_pass_by_value.rs:92:49
48
73
|
49
74
LL | fn test_blanket_ref<T: Foo, S: Serialize>(vals: T, serializable: S) {}
50
- | ^ help: consider taking a reference instead: `&T`
75
+ | ^
76
+ |
77
+ help: consider taking a reference instead
78
+ |
79
+ LL | fn test_blanket_ref<T: Foo, S: Serialize>(vals: &T, serializable: S) {}
80
+ | +
51
81
52
82
error: this argument is passed by value, but not consumed in the function body
53
83
--> tests/ui/needless_pass_by_value.rs:95:18
54
84
|
55
85
LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
56
- | ^^^^^^ help: consider taking a reference instead: `&String`
86
+ | ^^^^^^
87
+ |
88
+ help: consider taking a reference instead
89
+ |
90
+ LL | fn issue_2114(s: &String, t: String, u: Vec<i32>, v: Vec<i32>) {
91
+ | +
57
92
58
93
error: this argument is passed by value, but not consumed in the function body
59
94
--> tests/ui/needless_pass_by_value.rs:95:29
@@ -76,7 +111,12 @@ error: this argument is passed by value, but not consumed in the function body
76
111
--> tests/ui/needless_pass_by_value.rs:95:40
77
112
|
78
113
LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
79
- | ^^^^^^^^ help: consider taking a reference instead: `&Vec<i32>`
114
+ | ^^^^^^^^
115
+ |
116
+ help: consider taking a reference instead
117
+ |
118
+ LL | fn issue_2114(s: String, t: String, u: &Vec<i32>, v: Vec<i32>) {
119
+ | +
80
120
81
121
error: this argument is passed by value, but not consumed in the function body
82
122
--> tests/ui/needless_pass_by_value.rs:95:53
@@ -105,109 +145,175 @@ error: this argument is passed by value, but not consumed in the function body
105
145
--> tests/ui/needless_pass_by_value.rs:115:12
106
146
|
107
147
LL | t: String,
108
- | ^^^^^^ help: consider taking a reference instead: `&String`
148
+ | ^^^^^^
149
+ |
150
+ help: consider taking a reference instead
151
+ |
152
+ LL | t: &String,
153
+ | +
109
154
110
155
error: this argument is passed by value, but not consumed in the function body
111
156
--> tests/ui/needless_pass_by_value.rs:125:23
112
157
|
113
158
LL | fn baz(&self, uu: U, ss: Self) {}
114
- | ^ help: consider taking a reference instead: `&U`
159
+ | ^
160
+ |
161
+ help: consider taking a reference instead
162
+ |
163
+ LL | fn baz(&self, uu: &U, ss: Self) {}
164
+ | +
115
165
116
166
error: this argument is passed by value, but not consumed in the function body
117
167
--> tests/ui/needless_pass_by_value.rs:125:30
118
168
|
119
169
LL | fn baz(&self, uu: U, ss: Self) {}
120
- | ^^^^ help: consider taking a reference instead: `&Self`
170
+ | ^^^^
171
+ |
172
+ help: consider taking a reference instead
173
+ |
174
+ LL | fn baz(&self, uu: U, ss: &Self) {}
175
+ | +
121
176
122
177
error: this argument is passed by value, but not consumed in the function body
123
178
--> tests/ui/needless_pass_by_value.rs:149:24
124
179
|
125
180
LL | fn bar_copy(x: u32, y: CopyWrapper) {
126
- | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
181
+ | ^^^^^^^^^^^
127
182
|
128
183
help: or consider marking this type as `Copy`
129
184
--> tests/ui/needless_pass_by_value.rs:147:1
130
185
|
131
186
LL | struct CopyWrapper(u32);
132
187
| ^^^^^^^^^^^^^^^^^^
188
+ help: consider taking a reference instead
189
+ |
190
+ LL | fn bar_copy(x: u32, y: &CopyWrapper) {
191
+ | +
133
192
134
193
error: this argument is passed by value, but not consumed in the function body
135
194
--> tests/ui/needless_pass_by_value.rs:157:29
136
195
|
137
196
LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
138
- | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
197
+ | ^^^^^^^^^^^
139
198
|
140
199
help: or consider marking this type as `Copy`
141
200
--> tests/ui/needless_pass_by_value.rs:147:1
142
201
|
143
202
LL | struct CopyWrapper(u32);
144
203
| ^^^^^^^^^^^^^^^^^^
204
+ help: consider taking a reference instead
205
+ |
206
+ LL | fn test_destructure_copy(x: &CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
207
+ | +
145
208
146
209
error: this argument is passed by value, but not consumed in the function body
147
210
--> tests/ui/needless_pass_by_value.rs:157:45
148
211
|
149
212
LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
150
- | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
213
+ | ^^^^^^^^^^^
151
214
|
152
215
help: or consider marking this type as `Copy`
153
216
--> tests/ui/needless_pass_by_value.rs:147:1
154
217
|
155
218
LL | struct CopyWrapper(u32);
156
219
| ^^^^^^^^^^^^^^^^^^
220
+ help: consider taking a reference instead
221
+ |
222
+ LL | fn test_destructure_copy(x: CopyWrapper, y: &CopyWrapper, z: CopyWrapper) {
223
+ | +
157
224
158
225
error: this argument is passed by value, but not consumed in the function body
159
226
--> tests/ui/needless_pass_by_value.rs:157:61
160
227
|
161
228
LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
162
- | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
229
+ | ^^^^^^^^^^^
163
230
|
164
231
help: or consider marking this type as `Copy`
165
232
--> tests/ui/needless_pass_by_value.rs:147:1
166
233
|
167
234
LL | struct CopyWrapper(u32);
168
235
| ^^^^^^^^^^^^^^^^^^
236
+ help: consider taking a reference instead
237
+ |
238
+ LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: &CopyWrapper) {
239
+ | +
169
240
170
241
error: this argument is passed by value, but not consumed in the function body
171
242
--> tests/ui/needless_pass_by_value.rs:173:40
172
243
|
173
244
LL | fn some_fun<'b, S: Bar<'b, ()>>(items: S) {}
174
- | ^ help: consider taking a reference instead: `&S`
245
+ | ^
246
+ |
247
+ help: consider taking a reference instead
248
+ |
249
+ LL | fn some_fun<'b, S: Bar<'b, ()>>(items: &S) {}
250
+ | +
175
251
176
252
error: this argument is passed by value, but not consumed in the function body
177
253
--> tests/ui/needless_pass_by_value.rs:179:20
178
254
|
179
255
LL | fn more_fun(items: impl Club<'static, i32>) {}
180
- | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&impl Club<'static, i32>`
256
+ | ^^^^^^^^^^^^^^^^^^^^^^^
257
+ |
258
+ help: consider taking a reference instead
259
+ |
260
+ LL | fn more_fun(items: &impl Club<'static, i32>) {}
261
+ | +
181
262
182
263
error: this argument is passed by value, but not consumed in the function body
183
264
--> tests/ui/needless_pass_by_value.rs:194:24
184
265
|
185
266
LL | fn option_inner_ref(x: Option<String>) {
186
- | ^^^^^^^^^^^^^^ help: consider taking a reference instead: `Option<&String>`
267
+ | ^^^^^^^^^^^^^^
268
+ |
269
+ help: consider taking a reference instead
270
+ |
271
+ LL | fn option_inner_ref(x: Option<&String>) {
272
+ | +
187
273
188
274
error: this argument is passed by value, but not consumed in the function body
189
275
--> tests/ui/needless_pass_by_value.rs:204:27
190
276
|
191
277
LL | fn non_standard_option(x: non_standard::Option<String>) {
192
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&non_standard::Option<String>`
278
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
279
+ |
280
+ help: consider taking a reference instead
281
+ |
282
+ LL | fn non_standard_option(x: &non_standard::Option<String>) {
283
+ | +
193
284
194
285
error: this argument is passed by value, but not consumed in the function body
195
286
--> tests/ui/needless_pass_by_value.rs:209:22
196
287
|
197
288
LL | fn option_by_name(x: Option<std::option::Option<core::option::Option<non_standard::Option<String>>>>) {
198
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `Option<std::option::Option<core::option::Option<&non_standard::Option<String>>>>`
289
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
290
+ |
291
+ help: consider taking a reference instead
292
+ |
293
+ LL | fn option_by_name(x: Option<std::option::Option<core::option::Option<&non_standard::Option<String>>>>) {
294
+ | +
199
295
200
296
error: this argument is passed by value, but not consumed in the function body
201
297
--> tests/ui/needless_pass_by_value.rs:216:18
202
298
|
203
299
LL | fn non_option(x: OptStr) {
204
- | ^^^^^^ help: consider taking a reference instead: `&OptStr`
300
+ | ^^^^^^
301
+ |
302
+ help: consider taking a reference instead
303
+ |
304
+ LL | fn non_option(x: &OptStr) {
305
+ | +
205
306
206
307
error: this argument is passed by value, but not consumed in the function body
207
308
--> tests/ui/needless_pass_by_value.rs:223:25
208
309
|
209
310
LL | fn non_option_either(x: Opt<String>) {
210
- | ^^^^^^^^^^^ help: consider taking a reference instead: `&Opt<String>`
311
+ | ^^^^^^^^^^^
312
+ |
313
+ help: consider taking a reference instead
314
+ |
315
+ LL | fn non_option_either(x: &Opt<String>) {
316
+ | +
211
317
212
318
error: aborting due to 27 previous errors
213
319
0 commit comments