about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Russo <mcr431@nyu.edu>2018-08-21 21:09:48 -0400
committerMatthew Russo <mcr431@nyu.edu>2018-08-24 08:50:00 -0400
commit34e76375ce08a73b4e9a14a8b2bff817b6586478 (patch)
tree9d2448bcf949a9703ff718ae53dc369e49bd1573
parentaa2abeaf342223da4da47b839b51549f7bcd5ef5 (diff)
downloadrust-34e76375ce08a73b4e9a14a8b2bff817b6586478.tar.gz
rust-34e76375ce08a73b4e9a14a8b2bff817b6586478.zip
Removing GenericArgMismatchErrorCode.
-rw-r--r--src/librustc_typeck/astconv.rs28
1 files changed, 2 insertions, 26 deletions
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs
index ccdb751bc4e..4f8f1f23254 100644
--- a/src/librustc_typeck/astconv.rs
+++ b/src/librustc_typeck/astconv.rs
@@ -99,12 +99,6 @@ enum GenericArgPosition {
     MethodCall,
 }
 
-// FIXME(#53525): these error codes should all be unified.
-struct GenericArgMismatchErrorCode {
-    lifetimes: (&'static str, &'static str),
-    types: (&'static str, &'static str),
-}
-
 /// Dummy type used for the `Self` of a `TraitRef` created for converting
 /// a trait object, and which gets removed in `ExistentialTraitRef`.
 /// This type must not appear anywhere in other converted types.
@@ -262,10 +256,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
             },
             def.parent.is_none() && def.has_self, // `has_self`
             seg.infer_types || suppress_mismatch, // `infer_types`
-            GenericArgMismatchErrorCode {
-                lifetimes: ("E0090", "E0088"),
-                types: ("E0089", "E0087"),
-            },
         )
     }
 
@@ -279,7 +269,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
         position: GenericArgPosition,
         has_self: bool,
         infer_types: bool,
-        error_codes: GenericArgMismatchErrorCode,
     ) -> bool {
         // At this stage we are guaranteed that the generic arguments are in the correct order, e.g.
         // 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 {
             }
         }
 
-        let check_kind_count = |error_code: (&str, &str),
-                                kind,
+        let check_kind_count = |kind,
                                 required,
                                 permitted,
                                 provided,
@@ -384,13 +372,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
                     bound,
                     provided,
                 ),
-                DiagnosticId::Error({
-                    if provided <= permitted {
-                        error_code.0
-                    } else {
-                        error_code.1
-                    }
-                }.into())
+                DiagnosticId::Error("E0107".into())
             ).span_label(span, label).emit();
 
             provided > required // `suppress_error`
@@ -398,7 +380,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
 
         if !infer_lifetimes || arg_counts.lifetimes > param_counts.lifetimes {
             check_kind_count(
-                error_codes.lifetimes,
                 "lifetime",
                 param_counts.lifetimes,
                 param_counts.lifetimes,
@@ -409,7 +390,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
         if !infer_types
             || arg_counts.types > param_counts.types - defaults.types - has_self as usize {
             check_kind_count(
-                error_codes.types,
                 "type",
                 param_counts.types - defaults.types - has_self as usize,
                 param_counts.types - has_self as usize,
@@ -587,10 +567,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
             GenericArgPosition::Type,
             has_self,
             infer_types,
-            GenericArgMismatchErrorCode {
-                lifetimes: ("E0107", "E0107"),
-                types: ("E0243", "E0244"),
-            },
         );
 
         let is_object = self_ty.map_or(false, |ty| ty.sty == TRAIT_OBJECT_DUMMY_SELF);