@@ -15,7 +15,7 @@ use crate::check::{
1515use crate :: structured_errors:: StructuredDiagnostic ;
1616
1717use rustc_ast as ast;
18- use rustc_errors:: { Applicability , Diagnostic , DiagnosticId , MultiSpan } ;
18+ use rustc_errors:: { pluralize , Applicability , Diagnostic , DiagnosticId , MultiSpan } ;
1919use rustc_hir as hir;
2020use rustc_hir:: def:: { CtorOf , DefKind , Res } ;
2121use rustc_hir:: def_id:: DefId ;
@@ -645,7 +645,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
645645 "argument"
646646 ) ,
647647 potentially_plural_count( provided_args. len( ) , "argument" ) ,
648- if provided_args. len( ) == 1 { "was" } else { "were" }
648+ pluralize! ( "was" , provided_args. len( ) )
649649 ) ,
650650 DiagnosticId :: Error ( err_code. to_owned ( ) ) ,
651651 ) ;
@@ -770,7 +770,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
770770 if c_variadic { "at least " } else { "" } ,
771771 potentially_plural_count( formal_and_expected_inputs. len( ) , "argument" ) ,
772772 potentially_plural_count( provided_args. len( ) , "argument" ) ,
773- if provided_args. len( ) == 1 { "was" } else { "were" }
773+ pluralize! ( "was" , provided_args. len( ) )
774774 ) ,
775775 DiagnosticId :: Error ( err_code. to_owned ( ) ) ,
776776 )
0 commit comments