Skip to content

Commit ab9e3a6

Browse files
committed
Adjust error message for method type mismatch
Closes #10118, Closes #5925
1 parent 51bdec1 commit ab9e3a6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ pub fn compare_impl_method(tcx: ty::ctxt,
864864
tcx.sess.span_err(
865865
impl_m_span,
866866
format!("method `{}` has {} parameter{} \
867-
but the trait method `{}` has {}",
867+
but the declaration in trait `{}` has {}",
868868
tcx.sess.str_of(trait_m.ident),
869869
impl_m.fty.sig.inputs.len(),
870870
if impl_m.fty.sig.inputs.len() == 1 { "" } else { "s" },

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ trait foo {
1313
}
1414
impl foo for int {
1515
fn bar(&self) -> int {
16-
//~^ ERROR method `bar` has 0 parameters but the trait method `foo::bar` has 1
16+
//~^ ERROR method `bar` has 0 parameters but the declaration in trait `foo::bar` has 1
1717
*self
1818
}
1919
}

0 commit comments

Comments
 (0)