@@ -92,36 +92,64 @@ error[E0121]: the type placeholder `_` is not allowed within types on item signa
9292 |
9393LL | fn test6(_: _) { }
9494 | ^ not allowed in type signatures
95+ |
96+ help: use type parameters instead
97+ |
98+ LL | fn test6<T>(_: T) { }
99+ | ^^^ ^
95100
96101error[E0121]: the type placeholder `_` is not allowed within types on item signatures
97102 --> $DIR/typeck_type_placeholder_item.rs:24:18
98103 |
99104LL | fn test6_b<T>(_: _, _: T) { }
100105 | ^ not allowed in type signatures
106+ |
107+ help: use type parameters instead
108+ |
109+ LL | fn test6_b<T, U>(_: U, _: T) { }
110+ | ^^^ ^
101111
102112error[E0121]: the type placeholder `_` is not allowed within types on item signatures
103113 --> $DIR/typeck_type_placeholder_item.rs:27:30
104114 |
105115LL | fn test6_c<T, K, L, A, B>(_: _, _: (T, K, L, A, B)) { }
106116 | ^ 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+ | ^^^ ^
107122
108123error[E0121]: the type placeholder `_` is not allowed within types on item signatures
109124 --> $DIR/typeck_type_placeholder_item.rs:30:13
110125 |
111126LL | fn test7(x: _) { let _x: usize = x; }
112127 | ^ 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+ | ^^^ ^
113133
114134error[E0121]: the type placeholder `_` is not allowed within types on item signatures
115135 --> $DIR/typeck_type_placeholder_item.rs:33:22
116136 |
117137LL | 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`
119142
120143error[E0121]: the type placeholder `_` is not allowed within types on item signatures
121144 --> $DIR/typeck_type_placeholder_item.rs:33:22
122145 |
123146LL | fn test8(_f: fn() -> _) { }
124147 | ^ not allowed in type signatures
148+ |
149+ help: use type parameters instead
150+ |
151+ LL | fn test8<T>(_f: fn() -> T) { }
152+ | ^^^ ^
125153
126154error[E0121]: the type placeholder `_` is not allowed within types on item signatures
127155 --> $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
229257 |
230258LL | fn fn_test6(_: _) { }
231259 | ^ not allowed in type signatures
260+ |
261+ help: use type parameters instead
262+ |
263+ LL | fn fn_test6<T>(_: T) { }
264+ | ^^^ ^
232265
233266error[E0121]: the type placeholder `_` is not allowed within types on item signatures
234267 --> $DIR/typeck_type_placeholder_item.rs:97:20
235268 |
236269LL | fn fn_test7(x: _) { let _x: usize = x; }
237270 | ^ 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+ | ^^^ ^
238276
239277error[E0121]: the type placeholder `_` is not allowed within types on item signatures
240278 --> $DIR/typeck_type_placeholder_item.rs:100:29
241279 |
242280LL | 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`
244285
245286error[E0121]: the type placeholder `_` is not allowed within types on item signatures
246287 --> $DIR/typeck_type_placeholder_item.rs:100:29
247288 |
248289LL | fn fn_test8(_f: fn() -> _) { }
249290 | ^ not allowed in type signatures
291+ |
292+ help: use type parameters instead
293+ |
294+ LL | fn fn_test8<T>(_f: fn() -> T) { }
295+ | ^^^ ^
250296
251297error[E0121]: the type placeholder `_` is not allowed within types on item signatures
252298 --> $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
369415 |
370416LL | fn method_test1(&self, x: _);
371417 | ^ not allowed in type signatures
418+ |
419+ help: use type parameters instead
420+ |
421+ LL | fn method_test1<T>(&self, x: T);
422+ | ^^^ ^
372423
373424error[E0121]: the type placeholder `_` is not allowed within types on item signatures
374425 --> $DIR/typeck_type_placeholder_item.rs:142:31
@@ -377,18 +428,33 @@ LL | fn method_test2(&self, x: _) -> _;
377428 | ^ ^ not allowed in type signatures
378429 | |
379430 | not allowed in type signatures
431+ |
432+ help: use type parameters instead
433+ |
434+ LL | fn method_test2<T>(&self, x: T) -> T;
435+ | ^^^ ^ ^
380436
381437error[E0121]: the type placeholder `_` is not allowed within types on item signatures
382438 --> $DIR/typeck_type_placeholder_item.rs:144:31
383439 |
384440LL | fn method_test3(&self) -> _;
385441 | ^ not allowed in type signatures
442+ |
443+ help: use type parameters instead
444+ |
445+ LL | fn method_test3<T>(&self) -> T;
446+ | ^^^ ^
386447
387448error[E0121]: the type placeholder `_` is not allowed within types on item signatures
388449 --> $DIR/typeck_type_placeholder_item.rs:146:26
389450 |
390451LL | fn assoc_fn_test1(x: _);
391452 | ^ not allowed in type signatures
453+ |
454+ help: use type parameters instead
455+ |
456+ LL | fn assoc_fn_test1<T>(x: T);
457+ | ^^^ ^
392458
393459error[E0121]: the type placeholder `_` is not allowed within types on item signatures
394460 --> $DIR/typeck_type_placeholder_item.rs:148:26
@@ -397,12 +463,22 @@ LL | fn assoc_fn_test2(x: _) -> _;
397463 | ^ ^ not allowed in type signatures
398464 | |
399465 | not allowed in type signatures
466+ |
467+ help: use type parameters instead
468+ |
469+ LL | fn assoc_fn_test2<T>(x: T) -> T;
470+ | ^^^ ^ ^
400471
401472error[E0121]: the type placeholder `_` is not allowed within types on item signatures
402473 --> $DIR/typeck_type_placeholder_item.rs:150:28
403474 |
404475LL | fn assoc_fn_test3() -> _;
405476 | ^ not allowed in type signatures
477+ |
478+ help: use type parameters instead
479+ |
480+ LL | fn assoc_fn_test3<T>() -> T;
481+ | ^^^ ^
406482
407483error[E0121]: the type placeholder `_` is not allowed within types on item signatures
408484 --> $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
445521 |
446522LL | fn test10(&self, _x : _) { }
447523 | ^ not allowed in type signatures
524+ |
525+ help: use type parameters instead
526+ |
527+ LL | fn test10<T>(&self, _x : T) { }
528+ | ^^^ ^
448529
449530error[E0121]: the type placeholder `_` is not allowed within types on item signatures
450531 --> $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
460541 |
461542LL | fn clone_from(&mut self, other: _) { *self = Test9; }
462543 | ^ 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+ | ^^^ ^
463549
464550error[E0121]: the type placeholder `_` is not allowed within types on item signatures
465551 --> $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
475561 |
476562LL | fn fn_test10(&self, _x : _) { }
477563 | ^ not allowed in type signatures
564+ |
565+ help: use type parameters instead
566+ |
567+ LL | fn fn_test10<T>(&self, _x : T) { }
568+ | ^^^ ^
478569
479570error[E0121]: the type placeholder `_` is not allowed within types on item signatures
480571 --> $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
490581 |
491582LL | fn clone_from(&mut self, other: _) { *self = FnTest9; }
492583 | ^ 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+ | ^^^ ^
493589
494590error[E0121]: the type placeholder `_` is not allowed within types on item signatures
495591 --> $DIR/typeck_type_placeholder_item.rs:201:14
0 commit comments