@@ -2218,10 +2218,12 @@ fn check_type_argument_count(tcx: TyCtxt, span: Span, supplied: usize,
22182218 } else {
22192219 "expected"
22202220 } ;
2221+ let arguments_plural = if required == 1 { "" } else { "s" } ;
22212222 struct_span_err ! ( tcx. sess, span, E0243 , "wrong number of type arguments" )
22222223 . span_label (
22232224 span,
2224- & format ! ( "{} {} type arguments, found {}" , expected, required, supplied)
2225+ & format ! ( "{} {} type argument{}, found {}" ,
2226+ expected, required, arguments_plural, supplied)
22252227 )
22262228 . emit ( ) ;
22272229 } else if supplied > accepted {
@@ -2232,11 +2234,12 @@ fn check_type_argument_count(tcx: TyCtxt, span: Span, supplied: usize,
22322234 } else {
22332235 format ! ( "expected {}" , accepted)
22342236 } ;
2237+ let arguments_plural = if accepted == 1 { "" } else { "s" } ;
22352238
22362239 struct_span_err ! ( tcx. sess, span, E0244 , "wrong number of type arguments" )
22372240 . span_label (
22382241 span,
2239- & format ! ( "{} type arguments , found {}" , expected, supplied)
2242+ & format ! ( "{} type argument{} , found {}" , expected, arguments_plural , supplied)
22402243 )
22412244 . emit ( ) ;
22422245 }
0 commit comments