@@ -92,36 +92,64 @@ error[E0121]: the type placeholder `_` is not allowed within types on item signa
92
92
|
93
93
LL | fn test6(_: _) { }
94
94
| ^ not allowed in type signatures
95
+ |
96
+ help: use type parameters instead
97
+ |
98
+ LL | fn test6<T>(_: T) { }
99
+ | ^^^ ^
95
100
96
101
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
97
102
--> $DIR/typeck_type_placeholder_item.rs:24:18
98
103
|
99
104
LL | fn test6_b<T>(_: _, _: T) { }
100
105
| ^ not allowed in type signatures
106
+ |
107
+ help: use type parameters instead
108
+ |
109
+ LL | fn test6_b<T, U>(_: U, _: T) { }
110
+ | ^^^ ^
101
111
102
112
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
103
113
--> $DIR/typeck_type_placeholder_item.rs:27:30
104
114
|
105
115
LL | fn test6_c<T, K, L, A, B>(_: _, _: (T, K, L, A, B)) { }
106
116
| ^ not allowed in type signatures
117
+ |
118
+ help: use type parameters instead
119
+ |
120
+ LL | fn test6_c<T, K, L, A, B, U>(_: U, _: (T, K, L, A, B)) { }
121
+ | ^^^ ^
107
122
108
123
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
109
124
--> $DIR/typeck_type_placeholder_item.rs:30:13
110
125
|
111
126
LL | fn test7(x: _) { let _x: usize = x; }
112
127
| ^ not allowed in type signatures
128
+ |
129
+ help: use type parameters instead
130
+ |
131
+ LL | fn test7<T>(x: T) { let _x: usize = x; }
132
+ | ^^^ ^
113
133
114
134
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
115
135
--> $DIR/typeck_type_placeholder_item.rs:33:22
116
136
|
117
137
LL | fn test8(_f: fn() -> _) { }
118
- | ^ not allowed in type signatures
138
+ | ^
139
+ | |
140
+ | not allowed in type signatures
141
+ | help: use type parameters instead: `T`
119
142
120
143
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
121
144
--> $DIR/typeck_type_placeholder_item.rs:33:22
122
145
|
123
146
LL | fn test8(_f: fn() -> _) { }
124
147
| ^ not allowed in type signatures
148
+ |
149
+ help: use type parameters instead
150
+ |
151
+ LL | fn test8<T>(_f: fn() -> T) { }
152
+ | ^^^ ^
125
153
126
154
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
127
155
--> $DIR/typeck_type_placeholder_item.rs:47:26
@@ -229,24 +257,42 @@ error[E0121]: the type placeholder `_` is not allowed within types on item signa
229
257
|
230
258
LL | fn fn_test6(_: _) { }
231
259
| ^ not allowed in type signatures
260
+ |
261
+ help: use type parameters instead
262
+ |
263
+ LL | fn fn_test6<T>(_: T) { }
264
+ | ^^^ ^
232
265
233
266
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
234
267
--> $DIR/typeck_type_placeholder_item.rs:97:20
235
268
|
236
269
LL | fn fn_test7(x: _) { let _x: usize = x; }
237
270
| ^ not allowed in type signatures
271
+ |
272
+ help: use type parameters instead
273
+ |
274
+ LL | fn fn_test7<T>(x: T) { let _x: usize = x; }
275
+ | ^^^ ^
238
276
239
277
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
240
278
--> $DIR/typeck_type_placeholder_item.rs:100:29
241
279
|
242
280
LL | fn fn_test8(_f: fn() -> _) { }
243
- | ^ not allowed in type signatures
281
+ | ^
282
+ | |
283
+ | not allowed in type signatures
284
+ | help: use type parameters instead: `T`
244
285
245
286
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
246
287
--> $DIR/typeck_type_placeholder_item.rs:100:29
247
288
|
248
289
LL | fn fn_test8(_f: fn() -> _) { }
249
290
| ^ not allowed in type signatures
291
+ |
292
+ help: use type parameters instead
293
+ |
294
+ LL | fn fn_test8<T>(_f: fn() -> T) { }
295
+ | ^^^ ^
250
296
251
297
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
252
298
--> $DIR/typeck_type_placeholder_item.rs:123:12
@@ -369,6 +415,11 @@ error[E0121]: the type placeholder `_` is not allowed within types on item signa
369
415
|
370
416
LL | fn method_test1(&self, x: _);
371
417
| ^ not allowed in type signatures
418
+ |
419
+ help: use type parameters instead
420
+ |
421
+ LL | fn method_test1<T>(&self, x: T);
422
+ | ^^^ ^
372
423
373
424
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
374
425
--> $DIR/typeck_type_placeholder_item.rs:142:31
@@ -377,18 +428,33 @@ LL | fn method_test2(&self, x: _) -> _;
377
428
| ^ ^ not allowed in type signatures
378
429
| |
379
430
| not allowed in type signatures
431
+ |
432
+ help: use type parameters instead
433
+ |
434
+ LL | fn method_test2<T>(&self, x: T) -> T;
435
+ | ^^^ ^ ^
380
436
381
437
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
382
438
--> $DIR/typeck_type_placeholder_item.rs:144:31
383
439
|
384
440
LL | fn method_test3(&self) -> _;
385
441
| ^ not allowed in type signatures
442
+ |
443
+ help: use type parameters instead
444
+ |
445
+ LL | fn method_test3<T>(&self) -> T;
446
+ | ^^^ ^
386
447
387
448
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
388
449
--> $DIR/typeck_type_placeholder_item.rs:146:26
389
450
|
390
451
LL | fn assoc_fn_test1(x: _);
391
452
| ^ not allowed in type signatures
453
+ |
454
+ help: use type parameters instead
455
+ |
456
+ LL | fn assoc_fn_test1<T>(x: T);
457
+ | ^^^ ^
392
458
393
459
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
394
460
--> $DIR/typeck_type_placeholder_item.rs:148:26
@@ -397,12 +463,22 @@ LL | fn assoc_fn_test2(x: _) -> _;
397
463
| ^ ^ not allowed in type signatures
398
464
| |
399
465
| not allowed in type signatures
466
+ |
467
+ help: use type parameters instead
468
+ |
469
+ LL | fn assoc_fn_test2<T>(x: T) -> T;
470
+ | ^^^ ^ ^
400
471
401
472
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
402
473
--> $DIR/typeck_type_placeholder_item.rs:150:28
403
474
|
404
475
LL | fn assoc_fn_test3() -> _;
405
476
| ^ not allowed in type signatures
477
+ |
478
+ help: use type parameters instead
479
+ |
480
+ LL | fn assoc_fn_test3<T>() -> T;
481
+ | ^^^ ^
406
482
407
483
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
408
484
--> $DIR/typeck_type_placeholder_item.rs:190:14
@@ -445,6 +521,11 @@ error[E0121]: the type placeholder `_` is not allowed within types on item signa
445
521
|
446
522
LL | fn test10(&self, _x : _) { }
447
523
| ^ not allowed in type signatures
524
+ |
525
+ help: use type parameters instead
526
+ |
527
+ LL | fn test10<T>(&self, _x : T) { }
528
+ | ^^^ ^
448
529
449
530
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
450
531
--> $DIR/typeck_type_placeholder_item.rs:58:24
@@ -460,6 +541,11 @@ error[E0121]: the type placeholder `_` is not allowed within types on item signa
460
541
|
461
542
LL | fn clone_from(&mut self, other: _) { *self = Test9; }
462
543
| ^ not allowed in type signatures
544
+ |
545
+ help: use type parameters instead
546
+ |
547
+ LL | fn clone_from<T>(&mut self, other: T) { *self = Test9; }
548
+ | ^^^ ^
463
549
464
550
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
465
551
--> $DIR/typeck_type_placeholder_item.rs:107:31
@@ -475,6 +561,11 @@ error[E0121]: the type placeholder `_` is not allowed within types on item signa
475
561
|
476
562
LL | fn fn_test10(&self, _x : _) { }
477
563
| ^ not allowed in type signatures
564
+ |
565
+ help: use type parameters instead
566
+ |
567
+ LL | fn fn_test10<T>(&self, _x : T) { }
568
+ | ^^^ ^
478
569
479
570
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
480
571
--> $DIR/typeck_type_placeholder_item.rs:115:28
@@ -490,6 +581,11 @@ error[E0121]: the type placeholder `_` is not allowed within types on item signa
490
581
|
491
582
LL | fn clone_from(&mut self, other: _) { *self = FnTest9; }
492
583
| ^ not allowed in type signatures
584
+ |
585
+ help: use type parameters instead
586
+ |
587
+ LL | fn clone_from<T>(&mut self, other: T) { *self = FnTest9; }
588
+ | ^^^ ^
493
589
494
590
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
495
591
--> $DIR/typeck_type_placeholder_item.rs:201:14
0 commit comments