diff options
| author | bors <bors@rust-lang.org> | 2015-11-10 15:48:00 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-11-10 15:48:00 +0000 |
| commit | 05b66b8a1c74fe1182e594b330a4f5ab502eacc4 (patch) | |
| tree | d0ae725bef4e6fe83a178cde62040d34787e87a7 | |
| parent | e9aa32ac728b297ed8f62e592e1de5ac86b6e4a3 (diff) | |
| parent | 8bad0311904b61766862da572bc3d5e2adebdb36 (diff) | |
| download | rust-05b66b8a1c74fe1182e594b330a4f5ab502eacc4.tar.gz rust-05b66b8a1c74fe1182e594b330a4f5ab502eacc4.zip | |
Auto merge of #29705 - Ryman:mismatched_typaram_counts, r=alexcrichton
…type-params for methods
| -rw-r--r-- | src/librustc_typeck/check/method/confirm.rs | 3 | ||||
| -rw-r--r-- | src/test/compile-fail/trait-test-2.rs | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/librustc_typeck/check/method/confirm.rs b/src/librustc_typeck/check/method/confirm.rs index 72131627aa5..d038890b908 100644 --- a/src/librustc_typeck/check/method/confirm.rs +++ b/src/librustc_typeck/check/method/confirm.rs @@ -351,7 +351,8 @@ impl<'a,'tcx> ConfirmContext<'a,'tcx> { method_types); } else if num_supplied_types != num_method_types { span_err!(self.tcx().sess, self.span, E0036, - "incorrect number of type parameters given for this method"); + "incorrect number of type parameters given for this method: expected {}, found {}", + num_method_types, num_supplied_types); final_substs.types.replace( subst::FnSpace, vec![self.tcx().types.err; num_method_types]); diff --git a/src/test/compile-fail/trait-test-2.rs b/src/test/compile-fail/trait-test-2.rs index 13fe314fbcd..73be7cf0dc0 100644 --- a/src/test/compile-fail/trait-test-2.rs +++ b/src/test/compile-fail/trait-test-2.rs @@ -16,7 +16,8 @@ impl bar for u32 { fn dup(&self) -> u32 { *self } fn blah<X>(&self) {} } fn main() { 10.dup::<i32>(); //~ ERROR does not take type parameters - 10.blah::<i32, i32>(); //~ ERROR incorrect number of type parameters + 10.blah::<i32, i32>(); + //~^ ERROR incorrect number of type parameters given for this method: expected 1, found 2 (box 10 as Box<bar>).dup(); //~^ ERROR E0038 //~| ERROR E0038 |
