Skip to content

Commit 052c482

Browse files
committed
Improve the error messages for mismatched numbers of type params.
1 parent f92b75a commit 052c482

File tree

1 file changed

+6
-2
lines changed
  • src/librustc/middle/typeck/check

1 file changed

+6
-2
lines changed

src/librustc/middle/typeck/check/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3327,11 +3327,15 @@ pub fn instantiate_path(fcx: @mut FnCtxt,
33273327
fcx.infcx().next_ty_vars(ty_param_count)
33283328
} else if ty_substs_len > ty_param_count {
33293329
fcx.ccx.tcx.sess.span_err
3330-
(span, "too many type parameters provided for this item");
3330+
(span,
3331+
fmt!("too many type parameters provided: expected %u, found %u",
3332+
ty_param_count, ty_substs_len));
33313333
fcx.infcx().next_ty_vars(ty_param_count)
33323334
} else if ty_substs_len < ty_param_count {
33333335
fcx.ccx.tcx.sess.span_err
3334-
(span, "not enough type parameters provided for this item");
3336+
(span,
3337+
fmt!("not enough type parameters provided: expected %u, found %u",
3338+
ty_param_count, ty_substs_len));
33353339
fcx.infcx().next_ty_vars(ty_param_count)
33363340
} else {
33373341
pth.types.map(|aty| fcx.to_ty(aty))

0 commit comments

Comments
 (0)