// 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`
);
parent_substs,
false,
None,
+ arg_count_mismatch,
// Provide the generic args, and whether types should be inferred.
- |_| {
- // The last argument of the returned tuple here is unimportant.
- if let Some(ref data) = seg.args { (Some(data), false) } else { (None, false) }
+ |def_id| {
+ // The last component of the returned tuple here is unimportant.
+ if def_id == pick.item.def_id {
+ if let Some(ref data) = seg.args {
+ return (Some(data), false);
+ }
+ }
+ (None, false)
},
// Provide substitutions for parameters for which (valid) arguments have been provided.
|param, arg| match (¶m.kind, arg) {