]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/method/confirm.rs
Move generic arg / param validation to `create_substs_for_generic_args`
[rust.git] / src / librustc_typeck / check / method / confirm.rs
index 04cbee8c94061ac77e946e285b09591759deb85a..e3fde9159cc38257993f2941dd70faa7cdcbc012 100644 (file)
@@ -299,7 +299,7 @@ fn instantiate_method_substs(
         // If they were not explicitly supplied, just construct fresh
         // variables.
         let generics = self.tcx.generics_of(pick.item.def_id);
-        AstConv::check_generic_arg_count_for_call(
+        let arg_count_mismatch = AstConv::check_generic_arg_count_for_call(
             self.tcx, self.span, &generics, &seg, true, // `is_method_call`
         );
 
@@ -313,6 +313,7 @@ fn instantiate_method_substs(
             parent_substs,
             false,
             None,
+            arg_count_mismatch,
             // Provide the generic args, and whether types should be inferred.
             |def_id| {
                 // The last component of the returned tuple here is unimportant.