@@ -99,12 +99,6 @@ enum GenericArgPosition {
99
99
MethodCall ,
100
100
}
101
101
102
- // FIXME(#53525): these error codes should all be unified.
103
- struct GenericArgMismatchErrorCode {
104
- lifetimes : ( & ' static str , & ' static str ) ,
105
- types : ( & ' static str , & ' static str ) ,
106
- }
107
-
108
102
/// Dummy type used for the `Self` of a `TraitRef` created for converting
109
103
/// a trait object, and which gets removed in `ExistentialTraitRef`.
110
104
/// This type must not appear anywhere in other converted types.
@@ -262,10 +256,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
262
256
} ,
263
257
def. parent . is_none ( ) && def. has_self , // `has_self`
264
258
seg. infer_types || suppress_mismatch, // `infer_types`
265
- GenericArgMismatchErrorCode {
266
- lifetimes : ( "E0090" , "E0088" ) ,
267
- types : ( "E0089" , "E0087" ) ,
268
- } ,
269
259
)
270
260
}
271
261
@@ -279,7 +269,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
279
269
position : GenericArgPosition ,
280
270
has_self : bool ,
281
271
infer_types : bool ,
282
- error_codes : GenericArgMismatchErrorCode ,
283
272
) -> bool {
284
273
// At this stage we are guaranteed that the generic arguments are in the correct order, e.g.
285
274
// that lifetimes will proceed types. So it suffices to check the number of each generic
@@ -325,8 +314,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
325
314
}
326
315
}
327
316
328
- let check_kind_count = |error_code : ( & str , & str ) ,
329
- kind,
317
+ let check_kind_count = |kind,
330
318
required,
331
319
permitted,
332
320
provided,
@@ -384,21 +372,14 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
384
372
bound,
385
373
provided,
386
374
) ,
387
- DiagnosticId :: Error ( {
388
- if provided <= permitted {
389
- error_code. 0
390
- } else {
391
- error_code. 1
392
- }
393
- } . into ( ) )
375
+ DiagnosticId :: Error ( "E0107" . into ( ) )
394
376
) . span_label ( span, label) . emit ( ) ;
395
377
396
378
provided > required // `suppress_error`
397
379
} ;
398
380
399
381
if !infer_lifetimes || arg_counts. lifetimes > param_counts. lifetimes {
400
382
check_kind_count (
401
- error_codes. lifetimes ,
402
383
"lifetime" ,
403
384
param_counts. lifetimes ,
404
385
param_counts. lifetimes ,
@@ -409,7 +390,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
409
390
if !infer_types
410
391
|| arg_counts. types > param_counts. types - defaults. types - has_self as usize {
411
392
check_kind_count (
412
- error_codes. types ,
413
393
"type" ,
414
394
param_counts. types - defaults. types - has_self as usize ,
415
395
param_counts. types - has_self as usize ,
@@ -587,10 +567,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
587
567
GenericArgPosition :: Type ,
588
568
has_self,
589
569
infer_types,
590
- GenericArgMismatchErrorCode {
591
- lifetimes : ( "E0107" , "E0107" ) ,
592
- types : ( "E0243" , "E0244" ) ,
593
- } ,
594
570
) ;
595
571
596
572
let is_object = self_ty. map_or ( false , |ty| ty. sty == TRAIT_OBJECT_DUMMY_SELF ) ;
0 commit comments