use crate::structured_errors::StructuredDiagnostic;
use rustc_ast as ast;
-use rustc_errors::{Applicability, Diagnostic, DiagnosticId, MultiSpan};
+use rustc_errors::{pluralize, Applicability, Diagnostic, DiagnosticId, MultiSpan};
use rustc_hir as hir;
use rustc_hir::def::{CtorOf, DefKind, Res};
use rustc_hir::def_id::DefId;
"argument"
),
potentially_plural_count(provided_args.len(), "argument"),
- if provided_args.len() == 1 { "was" } else { "were" }
+ pluralize!("was", provided_args.len())
),
DiagnosticId::Error(err_code.to_owned()),
);
if c_variadic { "at least " } else { "" },
potentially_plural_count(formal_and_expected_inputs.len(), "argument"),
potentially_plural_count(provided_args.len(), "argument"),
- if provided_args.len() == 1 { "was" } else { "were" }
+ pluralize!("was", provided_args.len())
),
DiagnosticId::Error(err_code.to_owned()),
)
let (_, expected_ty) = formal_and_expected_inputs[expected_idx];
if expected_ty.is_unit() {
"()".to_string()
- } else if expected_ty.is_suggestable(tcx) {
+ } else if expected_ty.is_suggestable(tcx, false) {
format!("/* {} */", expected_ty)
} else {
"/* value */".to_string()