1
1
error: expected identifier, found reserved identifier `_`
2
- --> $DIR/typeck_type_placeholder_item.rs:146 :18
2
+ --> $DIR/typeck_type_placeholder_item.rs:153 :18
3
3
|
4
4
LL | struct BadStruct<_>(_);
5
5
| ^ expected identifier, found reserved identifier
6
6
7
7
error: expected identifier, found reserved identifier `_`
8
- --> $DIR/typeck_type_placeholder_item.rs:149 :16
8
+ --> $DIR/typeck_type_placeholder_item.rs:156 :16
9
9
|
10
10
LL | trait BadTrait<_> {}
11
11
| ^ expected identifier, found reserved identifier
12
12
13
13
error: expected identifier, found reserved identifier `_`
14
- --> $DIR/typeck_type_placeholder_item.rs:159 :19
14
+ --> $DIR/typeck_type_placeholder_item.rs:166 :19
15
15
|
16
16
LL | struct BadStruct1<_, _>(_);
17
17
| ^ expected identifier, found reserved identifier
18
18
19
19
error: expected identifier, found reserved identifier `_`
20
- --> $DIR/typeck_type_placeholder_item.rs:159 :22
20
+ --> $DIR/typeck_type_placeholder_item.rs:166 :22
21
21
|
22
22
LL | struct BadStruct1<_, _>(_);
23
23
| ^ expected identifier, found reserved identifier
24
24
25
25
error: expected identifier, found reserved identifier `_`
26
- --> $DIR/typeck_type_placeholder_item.rs:164 :19
26
+ --> $DIR/typeck_type_placeholder_item.rs:171 :19
27
27
|
28
28
LL | struct BadStruct2<_, T>(_, T);
29
29
| ^ expected identifier, found reserved identifier
30
30
31
31
error[E0403]: the name `_` is already used for a generic parameter in this item's generic parameters
32
- --> $DIR/typeck_type_placeholder_item.rs:159 :22
32
+ --> $DIR/typeck_type_placeholder_item.rs:166 :22
33
33
|
34
34
LL | struct BadStruct1<_, _>(_);
35
35
| - ^ already used
@@ -177,8 +177,29 @@ LL |
177
177
LL | b: (T, T),
178
178
|
179
179
180
+ error: missing type for `static` item
181
+ --> $DIR/typeck_type_placeholder_item.rs:71:12
182
+ |
183
+ LL | static A = 42;
184
+ | ^ help: provide a type for the item: `A: i32`
185
+
186
+ error[E0121]: the type placeholder `_` is not allowed within types on item signatures
187
+ --> $DIR/typeck_type_placeholder_item.rs:73:15
188
+ |
189
+ LL | static B: _ = 42;
190
+ | ^
191
+ | |
192
+ | not allowed in type signatures
193
+ | help: replace `_` with the correct type: `i32`
194
+
195
+ error[E0121]: the type placeholder `_` is not allowed within types on item signatures
196
+ --> $DIR/typeck_type_placeholder_item.rs:75:15
197
+ |
198
+ LL | static C: Option<_> = Some(42);
199
+ | ^^^^^^^^^ not allowed in type signatures
200
+
180
201
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
181
- --> $DIR/typeck_type_placeholder_item.rs:71 :21
202
+ --> $DIR/typeck_type_placeholder_item.rs:78 :21
182
203
|
183
204
LL | fn fn_test() -> _ { 5 }
184
205
| ^
@@ -187,7 +208,7 @@ LL | fn fn_test() -> _ { 5 }
187
208
| help: replace with the correct return type: `i32`
188
209
189
210
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
190
- --> $DIR/typeck_type_placeholder_item.rs:74 :23
211
+ --> $DIR/typeck_type_placeholder_item.rs:81 :23
191
212
|
192
213
LL | fn fn_test2() -> (_, _) { (5, 5) }
193
214
| -^--^-
@@ -197,7 +218,7 @@ LL | fn fn_test2() -> (_, _) { (5, 5) }
197
218
| help: replace with the correct return type: `(i32, i32)`
198
219
199
220
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
200
- --> $DIR/typeck_type_placeholder_item.rs:77 :22
221
+ --> $DIR/typeck_type_placeholder_item.rs:84 :22
201
222
|
202
223
LL | static FN_TEST3: _ = "test";
203
224
| ^
@@ -206,7 +227,7 @@ LL | static FN_TEST3: _ = "test";
206
227
| help: replace `_` with the correct type: `&'static str`
207
228
208
229
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
209
- --> $DIR/typeck_type_placeholder_item.rs:80 :22
230
+ --> $DIR/typeck_type_placeholder_item.rs:87 :22
210
231
|
211
232
LL | static FN_TEST4: _ = 145;
212
233
| ^
@@ -215,13 +236,13 @@ LL | static FN_TEST4: _ = 145;
215
236
| help: replace `_` with the correct type: `i32`
216
237
217
238
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
218
- --> $DIR/typeck_type_placeholder_item.rs:83 :22
239
+ --> $DIR/typeck_type_placeholder_item.rs:90 :22
219
240
|
220
241
LL | static FN_TEST5: (_, _) = (1, 2);
221
242
| ^^^^^^ not allowed in type signatures
222
243
223
244
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
224
- --> $DIR/typeck_type_placeholder_item.rs:86 :20
245
+ --> $DIR/typeck_type_placeholder_item.rs:93 :20
225
246
|
226
247
LL | fn fn_test6(_: _) { }
227
248
| ^ not allowed in type signatures
@@ -232,7 +253,7 @@ LL | fn fn_test6<T>(_: T) { }
232
253
| ^^^ ^
233
254
234
255
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
235
- --> $DIR/typeck_type_placeholder_item.rs:89 :20
256
+ --> $DIR/typeck_type_placeholder_item.rs:96 :20
236
257
|
237
258
LL | fn fn_test7(x: _) { let _x: usize = x; }
238
259
| ^ not allowed in type signatures
@@ -243,13 +264,13 @@ LL | fn fn_test7<T>(x: T) { let _x: usize = x; }
243
264
| ^^^ ^
244
265
245
266
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
246
- --> $DIR/typeck_type_placeholder_item.rs:92 :29
267
+ --> $DIR/typeck_type_placeholder_item.rs:99 :29
247
268
|
248
269
LL | fn fn_test8(_f: fn() -> _) { }
249
270
| ^ not allowed in type signatures
250
271
251
272
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
252
- --> $DIR/typeck_type_placeholder_item.rs:92 :29
273
+ --> $DIR/typeck_type_placeholder_item.rs:99 :29
253
274
|
254
275
LL | fn fn_test8(_f: fn() -> _) { }
255
276
| ^ not allowed in type signatures
@@ -260,7 +281,7 @@ LL | fn fn_test8<T>(_f: fn() -> T) { }
260
281
| ^^^ ^
261
282
262
283
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
263
- --> $DIR/typeck_type_placeholder_item.rs:115 :12
284
+ --> $DIR/typeck_type_placeholder_item.rs:122 :12
264
285
|
265
286
LL | a: _,
266
287
| ^ not allowed in type signatures
@@ -279,21 +300,21 @@ LL | b: (T, T),
279
300
|
280
301
281
302
error[E0282]: type annotations needed
282
- --> $DIR/typeck_type_placeholder_item.rs:120 :27
303
+ --> $DIR/typeck_type_placeholder_item.rs:127 :27
283
304
|
284
305
LL | fn fn_test11(_: _) -> (_, _) { panic!() }
285
306
| ^^^^^^ cannot infer type
286
307
287
308
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
288
- --> $DIR/typeck_type_placeholder_item.rs:120 :28
309
+ --> $DIR/typeck_type_placeholder_item.rs:127 :28
289
310
|
290
311
LL | fn fn_test11(_: _) -> (_, _) { panic!() }
291
312
| ^ ^ not allowed in type signatures
292
313
| |
293
314
| not allowed in type signatures
294
315
295
316
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
296
- --> $DIR/typeck_type_placeholder_item.rs:124 :30
317
+ --> $DIR/typeck_type_placeholder_item.rs:131 :30
297
318
|
298
319
LL | fn fn_test12(x: i32) -> (_, _) { (x, x) }
299
320
| -^--^-
@@ -303,7 +324,7 @@ LL | fn fn_test12(x: i32) -> (_, _) { (x, x) }
303
324
| help: replace with the correct return type: `(i32, i32)`
304
325
305
326
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
306
- --> $DIR/typeck_type_placeholder_item.rs:127 :33
327
+ --> $DIR/typeck_type_placeholder_item.rs:134 :33
307
328
|
308
329
LL | fn fn_test13(x: _) -> (i32, _) { (x, x) }
309
330
| ------^-
@@ -312,7 +333,7 @@ LL | fn fn_test13(x: _) -> (i32, _) { (x, x) }
312
333
| help: replace with the correct return type: `(i32, i32)`
313
334
314
335
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
315
- --> $DIR/typeck_type_placeholder_item.rs:146 :21
336
+ --> $DIR/typeck_type_placeholder_item.rs:153 :21
316
337
|
317
338
LL | struct BadStruct<_>(_);
318
339
| ^ not allowed in type signatures
@@ -323,7 +344,7 @@ LL | struct BadStruct<T>(T);
323
344
| ^ ^
324
345
325
346
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
326
- --> $DIR/typeck_type_placeholder_item.rs:151 :15
347
+ --> $DIR/typeck_type_placeholder_item.rs:158 :15
327
348
|
328
349
LL | impl BadTrait<_> for BadStruct<_> {}
329
350
| ^ ^ not allowed in type signatures
@@ -336,13 +357,13 @@ LL | impl<T> BadTrait<T> for BadStruct<T> {}
336
357
| ^^^ ^ ^
337
358
338
359
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
339
- --> $DIR/typeck_type_placeholder_item.rs:154 :34
360
+ --> $DIR/typeck_type_placeholder_item.rs:161 :34
340
361
|
341
362
LL | fn impl_trait() -> impl BadTrait<_> {
342
363
| ^ not allowed in type signatures
343
364
344
365
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
345
- --> $DIR/typeck_type_placeholder_item.rs:159 :25
366
+ --> $DIR/typeck_type_placeholder_item.rs:166 :25
346
367
|
347
368
LL | struct BadStruct1<_, _>(_);
348
369
| ^ not allowed in type signatures
@@ -353,7 +374,7 @@ LL | struct BadStruct1<T, _>(T);
353
374
| ^ ^
354
375
355
376
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
356
- --> $DIR/typeck_type_placeholder_item.rs:164 :25
377
+ --> $DIR/typeck_type_placeholder_item.rs:171 :25
357
378
|
358
379
LL | struct BadStruct2<_, T>(_, T);
359
380
| ^ not allowed in type signatures
@@ -364,7 +385,7 @@ LL | struct BadStruct2<K, T>(K, T);
364
385
| ^ ^
365
386
366
387
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
367
- --> $DIR/typeck_type_placeholder_item.rs:168 :14
388
+ --> $DIR/typeck_type_placeholder_item.rs:175 :14
368
389
|
369
390
LL | type X = Box<_>;
370
391
| ^ not allowed in type signatures
@@ -381,7 +402,7 @@ LL | fn test10<T>(&self, _x : T) { }
381
402
| ^^^ ^
382
403
383
404
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
384
- --> $DIR/typeck_type_placeholder_item.rs:132 :31
405
+ --> $DIR/typeck_type_placeholder_item.rs:139 :31
385
406
|
386
407
LL | fn method_test1(&self, x: _);
387
408
| ^ not allowed in type signatures
@@ -392,7 +413,7 @@ LL | fn method_test1<T>(&self, x: T);
392
413
| ^^^ ^
393
414
394
415
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
395
- --> $DIR/typeck_type_placeholder_item.rs:134 :31
416
+ --> $DIR/typeck_type_placeholder_item.rs:141 :31
396
417
|
397
418
LL | fn method_test2(&self, x: _) -> _;
398
419
| ^ ^ not allowed in type signatures
@@ -405,7 +426,7 @@ LL | fn method_test2<T>(&self, x: T) -> T;
405
426
| ^^^ ^ ^
406
427
407
428
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
408
- --> $DIR/typeck_type_placeholder_item.rs:136 :31
429
+ --> $DIR/typeck_type_placeholder_item.rs:143 :31
409
430
|
410
431
LL | fn method_test3(&self) -> _;
411
432
| ^ not allowed in type signatures
@@ -416,7 +437,7 @@ LL | fn method_test3<T>(&self) -> T;
416
437
| ^^^ ^
417
438
418
439
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
419
- --> $DIR/typeck_type_placeholder_item.rs:138 :26
440
+ --> $DIR/typeck_type_placeholder_item.rs:145 :26
420
441
|
421
442
LL | fn assoc_fn_test1(x: _);
422
443
| ^ not allowed in type signatures
@@ -427,7 +448,7 @@ LL | fn assoc_fn_test1<T>(x: T);
427
448
| ^^^ ^
428
449
429
450
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
430
- --> $DIR/typeck_type_placeholder_item.rs:140 :26
451
+ --> $DIR/typeck_type_placeholder_item.rs:147 :26
431
452
|
432
453
LL | fn assoc_fn_test2(x: _) -> _;
433
454
| ^ ^ not allowed in type signatures
@@ -440,7 +461,7 @@ LL | fn assoc_fn_test2<T>(x: T) -> T;
440
461
| ^^^ ^ ^
441
462
442
463
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
443
- --> $DIR/typeck_type_placeholder_item.rs:142 :28
464
+ --> $DIR/typeck_type_placeholder_item.rs:149 :28
444
465
|
445
466
LL | fn assoc_fn_test3() -> _;
446
467
| ^ not allowed in type signatures
@@ -462,7 +483,7 @@ LL | fn clone_from<T>(&mut self, other: T) { *self = Test9; }
462
483
| ^^^ ^
463
484
464
485
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
465
- --> $DIR/typeck_type_placeholder_item.rs:102 :34
486
+ --> $DIR/typeck_type_placeholder_item.rs:109 :34
466
487
|
467
488
LL | fn fn_test10(&self, _x : _) { }
468
489
| ^ not allowed in type signatures
@@ -473,7 +494,7 @@ LL | fn fn_test10<T>(&self, _x : T) { }
473
494
| ^^^ ^
474
495
475
496
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
476
- --> $DIR/typeck_type_placeholder_item.rs:110 :41
497
+ --> $DIR/typeck_type_placeholder_item.rs:117 :41
477
498
|
478
499
LL | fn clone_from(&mut self, other: _) { *self = FnTest9; }
479
500
| ^ not allowed in type signatures
@@ -484,7 +505,7 @@ LL | fn clone_from<T>(&mut self, other: T) { *self = FnTest9; }
484
505
| ^^^ ^
485
506
486
507
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
487
- --> $DIR/typeck_type_placeholder_item.rs:174 :21
508
+ --> $DIR/typeck_type_placeholder_item.rs:181 :21
488
509
|
489
510
LL | type Y = impl Trait<_>;
490
511
| ^ not allowed in type signatures
@@ -508,7 +529,7 @@ LL | fn clone(&self) -> _ { Test9 }
508
529
| help: replace with the correct return type: `Test9`
509
530
510
531
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
511
- --> $DIR/typeck_type_placeholder_item.rs:99 :31
532
+ --> $DIR/typeck_type_placeholder_item.rs:106 :31
512
533
|
513
534
LL | fn fn_test9(&self) -> _ { () }
514
535
| ^
@@ -517,15 +538,15 @@ LL | fn fn_test9(&self) -> _ { () }
517
538
| help: replace with the correct return type: `()`
518
539
519
540
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
520
- --> $DIR/typeck_type_placeholder_item.rs:107 :28
541
+ --> $DIR/typeck_type_placeholder_item.rs:114 :28
521
542
|
522
543
LL | fn clone(&self) -> _ { FnTest9 }
523
544
| ^
524
545
| |
525
546
| not allowed in type signatures
526
547
| help: replace with the correct return type: `main::FnTest9`
527
548
528
- error: aborting due to 55 previous errors
549
+ error: aborting due to 58 previous errors
529
550
530
551
Some errors have detailed explanations: E0121, E0282, E0403.
531
552
For more information about an error, try `rustc --explain E0121`.
0 commit comments