Adjust error message for method type mismatch
Closes #10118, Closes #5925
This commit is contained in:
parent
51bdec18b0
commit
ab9e3a6652
|
@ -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" },
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue