1
Fork 0

Remove dcx arg from ReportErrorExt::add_args.

Because it also has a `DiagnosticBuilder` arg, which contains a `dcx`
reference.

Also rename some `builder` variables as `diag`, because that's the usual
name.
This commit is contained in:
Nicholas Nethercote 2024-02-12 15:18:18 +11:00
parent 30774b0061
commit e0a0cc2971
3 changed files with 62 additions and 76 deletions

View file

@ -445,7 +445,7 @@ pub fn format_interp_error<'tcx>(dcx: &DiagCtxt, e: InterpErrorInfo<'tcx>) -> St
#[allow(rustc::untranslatable_diagnostic)]
let mut diag = dcx.struct_allow("");
let msg = e.diagnostic_message();
e.add_args(dcx, &mut diag);
e.add_args(&mut diag);
let s = dcx.eagerly_translate_to_string(msg, diag.args());
diag.cancel();
s