@@ -99,12 +99,6 @@ enum GenericArgPosition {
9999 MethodCall ,
100100}
101101
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-
108102/// Dummy type used for the `Self` of a `TraitRef` created for converting
109103/// a trait object, and which gets removed in `ExistentialTraitRef`.
110104/// This type must not appear anywhere in other converted types.
@@ -262,10 +256,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
262256 } ,
263257 def. parent . is_none ( ) && def. has_self , // `has_self`
264258 seg. infer_types || suppress_mismatch, // `infer_types`
265- GenericArgMismatchErrorCode {
266- lifetimes : ( "E0090" , "E0088" ) ,
267- types : ( "E0089" , "E0087" ) ,
268- } ,
269259 )
270260 }
271261
@@ -279,7 +269,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
279269 position : GenericArgPosition ,
280270 has_self : bool ,
281271 infer_types : bool ,
282- error_codes : GenericArgMismatchErrorCode ,
283272 ) -> bool {
284273 // At this stage we are guaranteed that the generic arguments are in the correct order, e.g.
285274 // 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 {
325314 }
326315 }
327316
328- let check_kind_count = |error_code : ( & str , & str ) ,
329- kind,
317+ let check_kind_count = |kind,
330318 required,
331319 permitted,
332320 provided,
@@ -384,21 +372,14 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
384372 bound,
385373 provided,
386374 ) ,
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 ( ) )
394376 ) . span_label ( span, label) . emit ( ) ;
395377
396378 provided > required // `suppress_error`
397379 } ;
398380
399381 if !infer_lifetimes || arg_counts. lifetimes > param_counts. lifetimes {
400382 check_kind_count (
401- error_codes. lifetimes ,
402383 "lifetime" ,
403384 param_counts. lifetimes ,
404385 param_counts. lifetimes ,
@@ -409,7 +390,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
409390 if !infer_types
410391 || arg_counts. types > param_counts. types - defaults. types - has_self as usize {
411392 check_kind_count (
412- error_codes. types ,
413393 "type" ,
414394 param_counts. types - defaults. types - has_self as usize ,
415395 param_counts. types - has_self as usize ,
@@ -587,10 +567,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
587567 GenericArgPosition :: Type ,
588568 has_self,
589569 infer_types,
590- GenericArgMismatchErrorCode {
591- lifetimes : ( "E0107" , "E0107" ) ,
592- types : ( "E0243" , "E0244" ) ,
593- } ,
594570 ) ;
595571
596572 let is_object = self_ty. map_or ( false , |ty| ty. sty == TRAIT_OBJECT_DUMMY_SELF ) ;
0 commit comments