Skip to content

Commit ca73fbf

Browse files
author
Bill Wendling
committed
Use correct grammar for error message.
When the number of parameters is 1, then 'parameter' should remain singular. Otherwise pluralize it.
1 parent 5f13e9c commit ca73fbf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc/middle/typeck/collect.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,11 @@ pub fn compare_impl_method(tcx: ty::ctxt,
403403
if vec::len(impl_m.fty.sig.inputs) != vec::len(trait_m.fty.sig.inputs) {
404404
tcx.sess.span_err(
405405
cm.span,
406-
fmt!("method `%s` has %u parameters \
406+
fmt!("method `%s` has %u parameter%s \
407407
but the trait has %u",
408408
*tcx.sess.str_of(trait_m.ident),
409409
vec::len(impl_m.fty.sig.inputs),
410+
if vec::len(impl_m.fty.sig.inputs) == 1 { "" } else { "s" },
410411
vec::len(trait_m.fty.sig.inputs)));
411412
return;
412413
}

0 commit comments

Comments
 (0)