@@ -10,6 +10,7 @@ use rustc::util::common::ErrorReported;
1010use errors:: { Applicability , DiagnosticId } ;
1111
1212use syntax_pos:: Span ;
13+ use syntax:: errors:: pluralise;
1314
1415use super :: { Inherited , FnCtxt , potentially_plural_count} ;
1516
@@ -648,9 +649,9 @@ fn compare_number_of_generics<'tcx>(
648649 declaration has {} {kind} parameter{}",
649650 trait_. ident,
650651 impl_count,
651- if impl_count != 1 { "s" } else { "" } ,
652+ pluralise! ( impl_count ) ,
652653 trait_count,
653- if trait_count != 1 { "s" } else { "" } ,
654+ pluralise! ( trait_count ) ,
654655 kind = kind,
655656 ) ,
656657 DiagnosticId :: Error ( "E0049" . into ( ) ) ,
@@ -665,7 +666,7 @@ fn compare_number_of_generics<'tcx>(
665666 "expected {} {} parameter{}" ,
666667 trait_count,
667668 kind,
668- if trait_count != 1 { "s" } else { "" } ,
669+ pluralise! ( trait_count ) ,
669670 ) ) ;
670671 }
671672 for span in spans {
@@ -680,7 +681,7 @@ fn compare_number_of_generics<'tcx>(
680681 "found {} {} parameter{}{}" ,
681682 impl_count,
682683 kind,
683- if impl_count != 1 { "s" } else { "" } ,
684+ pluralise! ( impl_count ) ,
684685 suffix. unwrap_or_else( || String :: new( ) ) ,
685686 ) ) ;
686687 }
0 commit comments