1 error: expected identifier, found reserved identifier `_`
2 --> $DIR/typeck_type_placeholder_item.rs:154:18
4 LL | struct BadStruct<_>(_);
5 | ^ expected identifier, found reserved identifier
7 error: expected identifier, found reserved identifier `_`
8 --> $DIR/typeck_type_placeholder_item.rs:157:16
10 LL | trait BadTrait<_> {}
11 | ^ expected identifier, found reserved identifier
13 error: expected identifier, found reserved identifier `_`
14 --> $DIR/typeck_type_placeholder_item.rs:167:19
16 LL | struct BadStruct1<_, _>(_);
17 | ^ expected identifier, found reserved identifier
19 error: expected identifier, found reserved identifier `_`
20 --> $DIR/typeck_type_placeholder_item.rs:167:22
22 LL | struct BadStruct1<_, _>(_);
23 | ^ expected identifier, found reserved identifier
25 error: expected identifier, found reserved identifier `_`
26 --> $DIR/typeck_type_placeholder_item.rs:172:19
28 LL | struct BadStruct2<_, T>(_, T);
29 | ^ expected identifier, found reserved identifier
31 error: associated constant in `impl` without body
32 --> $DIR/typeck_type_placeholder_item.rs:205:5
37 | help: provide a definition for the constant: `= <expr>;`
39 error[E0403]: the name `_` is already used for a generic parameter in this item's generic parameters
40 --> $DIR/typeck_type_placeholder_item.rs:167:22
42 LL | struct BadStruct1<_, _>(_);
47 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
48 --> $DIR/typeck_type_placeholder_item.rs:7:14
50 LL | fn test() -> _ { 5 }
53 | not allowed in type signatures
54 | help: replace with the correct return type: `i32`
56 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
57 --> $DIR/typeck_type_placeholder_item.rs:10:16
59 LL | fn test2() -> (_, _) { (5, 5) }
62 | || not allowed in type signatures
63 | |not allowed in type signatures
64 | help: replace with the correct return type: `(i32, i32)`
66 error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
67 --> $DIR/typeck_type_placeholder_item.rs:13:15
69 LL | static TEST3: _ = "test";
72 | not allowed in type signatures
73 | help: replace with the correct type: `&str`
75 error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
76 --> $DIR/typeck_type_placeholder_item.rs:16:15
78 LL | static TEST4: _ = 145;
81 | not allowed in type signatures
82 | help: replace with the correct type: `i32`
84 error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
85 --> $DIR/typeck_type_placeholder_item.rs:19:15
87 LL | static TEST5: (_, _) = (1, 2);
88 | ^^^^^^ not allowed in type signatures
90 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
91 --> $DIR/typeck_type_placeholder_item.rs:22:13
93 LL | fn test6(_: _) { }
94 | ^ not allowed in type signatures
96 help: use type parameters instead
98 LL | fn test6<T>(_: T) { }
101 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
102 --> $DIR/typeck_type_placeholder_item.rs:25:18
104 LL | fn test6_b<T>(_: _, _: T) { }
105 | ^ not allowed in type signatures
107 help: use type parameters instead
109 LL | fn test6_b<T, U>(_: U, _: T) { }
112 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
113 --> $DIR/typeck_type_placeholder_item.rs:28:30
115 LL | fn test6_c<T, K, L, A, B>(_: _, _: (T, K, L, A, B)) { }
116 | ^ not allowed in type signatures
118 help: use type parameters instead
120 LL | fn test6_c<T, K, L, A, B, U>(_: U, _: (T, K, L, A, B)) { }
123 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
124 --> $DIR/typeck_type_placeholder_item.rs:31:13
126 LL | fn test7(x: _) { let _x: usize = x; }
127 | ^ not allowed in type signatures
129 help: use type parameters instead
131 LL | fn test7<T>(x: T) { let _x: usize = x; }
134 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
135 --> $DIR/typeck_type_placeholder_item.rs:34:22
137 LL | fn test8(_f: fn() -> _) { }
140 | not allowed in type signatures
141 | help: use type parameters instead: `T`
143 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
144 --> $DIR/typeck_type_placeholder_item.rs:34:22
146 LL | fn test8(_f: fn() -> _) { }
147 | ^ not allowed in type signatures
149 help: use type parameters instead
151 LL | fn test8<T>(_f: fn() -> T) { }
154 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
155 --> $DIR/typeck_type_placeholder_item.rs:48:26
157 LL | fn test11(x: &usize) -> &_ {
160 | |not allowed in type signatures
161 | help: replace with the correct return type: `&'static &'static usize`
163 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
164 --> $DIR/typeck_type_placeholder_item.rs:53:52
166 LL | unsafe fn test12(x: *const usize) -> *const *const _ {
169 | | not allowed in type signatures
170 | help: replace with the correct return type: `*const *const usize`
172 error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs
173 --> $DIR/typeck_type_placeholder_item.rs:67:8
176 | ^ not allowed in type signatures
179 | ^ ^ not allowed in type signatures
181 | not allowed in type signatures
183 help: use type parameters instead
185 LL ~ struct Test10<T> {
191 error: missing type for `static` item
192 --> $DIR/typeck_type_placeholder_item.rs:73:13
195 | ^ help: provide a type for the static variable: `: i32`
197 error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
198 --> $DIR/typeck_type_placeholder_item.rs:75:15
200 LL | static B: _ = 42;
203 | not allowed in type signatures
204 | help: replace with the correct type: `i32`
206 error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
207 --> $DIR/typeck_type_placeholder_item.rs:77:15
209 LL | static C: Option<_> = Some(42);
210 | ^^^^^^^^^ not allowed in type signatures
212 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
213 --> $DIR/typeck_type_placeholder_item.rs:79:21
215 LL | fn fn_test() -> _ { 5 }
218 | not allowed in type signatures
219 | help: replace with the correct return type: `i32`
221 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
222 --> $DIR/typeck_type_placeholder_item.rs:82:23
224 LL | fn fn_test2() -> (_, _) { (5, 5) }
227 | || not allowed in type signatures
228 | |not allowed in type signatures
229 | help: replace with the correct return type: `(i32, i32)`
231 error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
232 --> $DIR/typeck_type_placeholder_item.rs:85:22
234 LL | static FN_TEST3: _ = "test";
237 | not allowed in type signatures
238 | help: replace with the correct type: `&str`
240 error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
241 --> $DIR/typeck_type_placeholder_item.rs:88:22
243 LL | static FN_TEST4: _ = 145;
246 | not allowed in type signatures
247 | help: replace with the correct type: `i32`
249 error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
250 --> $DIR/typeck_type_placeholder_item.rs:91:22
252 LL | static FN_TEST5: (_, _) = (1, 2);
253 | ^^^^^^ not allowed in type signatures
255 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
256 --> $DIR/typeck_type_placeholder_item.rs:94:20
258 LL | fn fn_test6(_: _) { }
259 | ^ not allowed in type signatures
261 help: use type parameters instead
263 LL | fn fn_test6<T>(_: T) { }
266 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
267 --> $DIR/typeck_type_placeholder_item.rs:97:20
269 LL | fn fn_test7(x: _) { let _x: usize = x; }
270 | ^ not allowed in type signatures
272 help: use type parameters instead
274 LL | fn fn_test7<T>(x: T) { let _x: usize = x; }
277 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
278 --> $DIR/typeck_type_placeholder_item.rs:100:29
280 LL | fn fn_test8(_f: fn() -> _) { }
283 | not allowed in type signatures
284 | help: use type parameters instead: `T`
286 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
287 --> $DIR/typeck_type_placeholder_item.rs:100:29
289 LL | fn fn_test8(_f: fn() -> _) { }
290 | ^ not allowed in type signatures
292 help: use type parameters instead
294 LL | fn fn_test8<T>(_f: fn() -> T) { }
297 error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs
298 --> $DIR/typeck_type_placeholder_item.rs:123:12
301 | ^ not allowed in type signatures
304 | ^ ^ not allowed in type signatures
306 | not allowed in type signatures
308 help: use type parameters instead
310 LL ~ struct FnTest10<T> {
316 error[E0282]: type annotations needed
317 --> $DIR/typeck_type_placeholder_item.rs:128:18
319 LL | fn fn_test11(_: _) -> (_, _) { panic!() }
320 | ^ cannot infer type
322 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
323 --> $DIR/typeck_type_placeholder_item.rs:128:28
325 LL | fn fn_test11(_: _) -> (_, _) { panic!() }
326 | ^ ^ not allowed in type signatures
328 | not allowed in type signatures
330 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
331 --> $DIR/typeck_type_placeholder_item.rs:132:30
333 LL | fn fn_test12(x: i32) -> (_, _) { (x, x) }
336 | || not allowed in type signatures
337 | |not allowed in type signatures
338 | help: replace with the correct return type: `(i32, i32)`
340 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
341 --> $DIR/typeck_type_placeholder_item.rs:135:33
343 LL | fn fn_test13(x: _) -> (i32, _) { (x, x) }
346 | | not allowed in type signatures
347 | help: replace with the correct return type: `(i32, i32)`
349 error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs
350 --> $DIR/typeck_type_placeholder_item.rs:154:21
352 LL | struct BadStruct<_>(_);
353 | ^ not allowed in type signatures
355 help: use type parameters instead
357 LL | struct BadStruct<T>(T);
360 error[E0121]: the placeholder `_` is not allowed within types on item signatures for implementations
361 --> $DIR/typeck_type_placeholder_item.rs:159:15
363 LL | impl BadTrait<_> for BadStruct<_> {}
364 | ^ ^ not allowed in type signatures
366 | not allowed in type signatures
368 help: use type parameters instead
370 LL | impl<T> BadTrait<T> for BadStruct<T> {}
373 error[E0121]: the placeholder `_` is not allowed within types on item signatures for opaque types
374 --> $DIR/typeck_type_placeholder_item.rs:162:34
376 LL | fn impl_trait() -> impl BadTrait<_> {
377 | ^ not allowed in type signatures
379 error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs
380 --> $DIR/typeck_type_placeholder_item.rs:167:25
382 LL | struct BadStruct1<_, _>(_);
383 | ^ not allowed in type signatures
385 help: use type parameters instead
387 LL | struct BadStruct1<T, _>(T);
390 error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs
391 --> $DIR/typeck_type_placeholder_item.rs:172:25
393 LL | struct BadStruct2<_, T>(_, T);
394 | ^ not allowed in type signatures
396 help: use type parameters instead
398 LL | struct BadStruct2<U, T>(U, T);
401 error[E0121]: the placeholder `_` is not allowed within types on item signatures for type aliases
402 --> $DIR/typeck_type_placeholder_item.rs:176:14
404 LL | type X = Box<_>;
405 | ^ not allowed in type signatures
407 error[E0121]: the placeholder `_` is not allowed within types on item signatures for opaque types
408 --> $DIR/typeck_type_placeholder_item.rs:182:21
410 LL | type Y = impl Trait<_>;
411 | ^ not allowed in type signatures
413 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
414 --> $DIR/typeck_type_placeholder_item.rs:216:31
416 LL | fn value() -> Option<&'static _> {
419 | | not allowed in type signatures
420 | help: replace with the correct return type: `Option<&'static u8>`
422 error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
423 --> $DIR/typeck_type_placeholder_item.rs:221:10
425 LL | const _: Option<_> = map(value);
428 | not allowed in type signatures
429 | help: replace with the correct type: `Option<u8>`
431 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
432 --> $DIR/typeck_type_placeholder_item.rs:140:31
434 LL | fn method_test1(&self, x: _);
435 | ^ not allowed in type signatures
437 help: use type parameters instead
439 LL | fn method_test1<T>(&self, x: T);
442 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
443 --> $DIR/typeck_type_placeholder_item.rs:142:31
445 LL | fn method_test2(&self, x: _) -> _;
446 | ^ ^ not allowed in type signatures
448 | not allowed in type signatures
450 help: use type parameters instead
452 LL | fn method_test2<T>(&self, x: T) -> T;
455 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
456 --> $DIR/typeck_type_placeholder_item.rs:144:31
458 LL | fn method_test3(&self) -> _;
459 | ^ not allowed in type signatures
461 help: use type parameters instead
463 LL | fn method_test3<T>(&self) -> T;
466 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
467 --> $DIR/typeck_type_placeholder_item.rs:146:26
469 LL | fn assoc_fn_test1(x: _);
470 | ^ not allowed in type signatures
472 help: use type parameters instead
474 LL | fn assoc_fn_test1<T>(x: T);
477 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
478 --> $DIR/typeck_type_placeholder_item.rs:148:26
480 LL | fn assoc_fn_test2(x: _) -> _;
481 | ^ ^ not allowed in type signatures
483 | not allowed in type signatures
485 help: use type parameters instead
487 LL | fn assoc_fn_test2<T>(x: T) -> T;
490 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
491 --> $DIR/typeck_type_placeholder_item.rs:150:28
493 LL | fn assoc_fn_test3() -> _;
494 | ^ not allowed in type signatures
496 help: use type parameters instead
498 LL | fn assoc_fn_test3<T>() -> T;
501 error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated types
502 --> $DIR/typeck_type_placeholder_item.rs:190:14
505 | ^ not allowed in type signatures
507 error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
508 --> $DIR/typeck_type_placeholder_item.rs:192:14
511 | ^ not allowed in type signatures
513 error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
514 --> $DIR/typeck_type_placeholder_item.rs:194:14
516 LL | const D: _ = 42;
519 | not allowed in type signatures
520 | help: replace with the correct type: `i32`
522 error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated types
523 --> $DIR/typeck_type_placeholder_item.rs:197:26
525 LL | type F: std::ops::Fn(_);
526 | ^ not allowed in type signatures
528 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
529 --> $DIR/typeck_type_placeholder_item.rs:41:24
531 LL | fn test9(&self) -> _ { () }
534 | not allowed in type signatures
535 | help: replace with the correct return type: `()`
537 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
538 --> $DIR/typeck_type_placeholder_item.rs:44:27
540 LL | fn test10(&self, _x : _) { }
541 | ^ not allowed in type signatures
543 help: use type parameters instead
545 LL | fn test10<T>(&self, _x : T) { }
548 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
549 --> $DIR/typeck_type_placeholder_item.rs:59:24
551 LL | fn clone(&self) -> _ { Test9 }
552 | ^ not allowed in type signatures
554 help: try replacing `_` with the type in the corresponding trait method signature
556 LL | fn clone(&self) -> Test9 { Test9 }
559 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
560 --> $DIR/typeck_type_placeholder_item.rs:62:37
562 LL | fn clone_from(&mut self, other: _) { *self = Test9; }
563 | ^ not allowed in type signatures
565 help: try replacing `_` with the type in the corresponding trait method signature
567 LL | fn clone_from(&mut self, other: &Test9) { *self = Test9; }
570 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
571 --> $DIR/typeck_type_placeholder_item.rs:107:31
573 LL | fn fn_test9(&self) -> _ { () }
576 | not allowed in type signatures
577 | help: replace with the correct return type: `()`
579 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
580 --> $DIR/typeck_type_placeholder_item.rs:110:34
582 LL | fn fn_test10(&self, _x : _) { }
583 | ^ not allowed in type signatures
585 help: use type parameters instead
587 LL | fn fn_test10<T>(&self, _x : T) { }
590 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
591 --> $DIR/typeck_type_placeholder_item.rs:115:28
593 LL | fn clone(&self) -> _ { FnTest9 }
594 | ^ not allowed in type signatures
596 help: try replacing `_` with the type in the corresponding trait method signature
598 LL | fn clone(&self) -> FnTest9 { FnTest9 }
601 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
602 --> $DIR/typeck_type_placeholder_item.rs:118:41
604 LL | fn clone_from(&mut self, other: _) { *self = FnTest9; }
605 | ^ not allowed in type signatures
607 help: try replacing `_` with the type in the corresponding trait method signature
609 LL | fn clone_from(&mut self, other: &FnTest9) { *self = FnTest9; }
612 error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated types
613 --> $DIR/typeck_type_placeholder_item.rs:201:14
616 | ^ not allowed in type signatures
618 error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated types
619 --> $DIR/typeck_type_placeholder_item.rs:203:14
622 | ^ not allowed in type signatures
624 error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
625 --> $DIR/typeck_type_placeholder_item.rs:205:14
628 | ^ not allowed in type signatures
630 error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
631 --> $DIR/typeck_type_placeholder_item.rs:208:14
633 LL | const D: _ = 42;
636 | not allowed in type signatures
637 | help: replace with the correct type: `i32`
639 error: aborting due to 69 previous errors
641 Some errors have detailed explanations: E0121, E0282, E0403.
642 For more information about an error, try `rustc --explain E0121`.