about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Sullivan <sully@msully.net>2013-07-11 15:08:31 -0700
committerMichael Sullivan <sully@msully.net>2013-07-11 15:51:09 -0700
commit052c482bbd87acc7ee824b6b8d2efb36c5b9917e (patch)
treeebf74b7db8721f34326d6b227d824a35d3ae9830
parentf92b75ac06a86daac8d230285b605ec2ed97214b (diff)
downloadrust-052c482bbd87acc7ee824b6b8d2efb36c5b9917e.tar.gz
rust-052c482bbd87acc7ee824b6b8d2efb36c5b9917e.zip
Improve the error messages for mismatched numbers of type params.
-rw-r--r--src/librustc/middle/typeck/check/mod.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs
index 5c8ce6b2d8b..4caf0b62a54 100644
--- a/src/librustc/middle/typeck/check/mod.rs
+++ b/src/librustc/middle/typeck/check/mod.rs
@@ -3327,11 +3327,15 @@ pub fn instantiate_path(fcx: @mut FnCtxt,
         fcx.infcx().next_ty_vars(ty_param_count)
     } else if ty_substs_len > ty_param_count {
         fcx.ccx.tcx.sess.span_err
-            (span, "too many type parameters provided for this item");
+            (span,
+             fmt!("too many type parameters provided: expected %u, found %u",
+                  ty_param_count, ty_substs_len));
         fcx.infcx().next_ty_vars(ty_param_count)
     } else if ty_substs_len < ty_param_count {
         fcx.ccx.tcx.sess.span_err
-            (span, "not enough type parameters provided for this item");
+            (span,
+             fmt!("not enough type parameters provided: expected %u, found %u",
+                  ty_param_count, ty_substs_len));
         fcx.infcx().next_ty_vars(ty_param_count)
     } else {
         pth.types.map(|aty| fcx.to_ty(aty))