Skip to content

Commit 520c3f5

Browse files
committed
correct error message and add to test
1 parent 3a2f1e1 commit 520c3f5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/comp/middle/typeck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ fn compare_impl_method(tcx: ty::ctxt, sp: span, impl_m: ty::method,
621621
"` has an incompatible set of type parameters");
622622
ty::mk_fn(tcx, impl_m.fty)
623623
} else if vec::len(impl_m.fty.inputs) != vec::len(if_m.fty.inputs) {
624-
tcx.sess.span_err(sp,#fmt["method `%s`` has %u parameters \
624+
tcx.sess.span_err(sp,#fmt["method `%s` has %u parameters \
625625
but the iface has %u",
626626
if_m.ident,
627627
vec::len(impl_m.fty.inputs),

src/test/compile-fail/iface-impl-different-num-params.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ iface foo {
33
}
44
impl of foo for int {
55
fn bar() -> int {
6+
//!^ ERROR method `bar` has 0 parameters but the iface has 1
67
self
78
}
89
}

0 commit comments

Comments
 (0)