Adjust error message for method type mismatch

Closes #10118, Closes #5925
This commit is contained in:
Corey Richardson 2013-11-15 23:57:12 -05:00
parent 51bdec18b0
commit ab9e3a6652
2 changed files with 2 additions and 2 deletions

View File

@ -864,7 +864,7 @@ pub fn compare_impl_method(tcx: ty::ctxt,
tcx.sess.span_err(
impl_m_span,
format!("method `{}` has {} parameter{} \
but the trait method `{}` has {}",
but the declaration in trait `{}` has {}",
tcx.sess.str_of(trait_m.ident),
impl_m.fty.sig.inputs.len(),
if impl_m.fty.sig.inputs.len() == 1 { "" } else { "s" },

View File

@ -13,7 +13,7 @@ trait foo {
}
impl foo for int {
fn bar(&self) -> int {
//~^ ERROR method `bar` has 0 parameters but the trait method `foo::bar` has 1
//~^ ERROR method `bar` has 0 parameters but the declaration in trait `foo::bar` has 1
*self
}
}