1
Fork 0

Remove Session methods that duplicate DiagCtxt methods.

Also add some `dcx` methods to types that wrap `TyCtxt`, for easier
access.
This commit is contained in:
Nicholas Nethercote 2023-12-18 22:21:37 +11:00
parent d51db05d7e
commit 99472c7049
298 changed files with 1806 additions and 2064 deletions

View file

@ -473,9 +473,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
backtrace.print_backtrace();
// FIXME(fee1-dead), HACK: we want to use the error as title therefore we can just extract the
// label and arguments from the InterpError.
let dcx = self.tcx.sess.dcx();
let dcx = self.tcx.dcx();
#[allow(rustc::untranslatable_diagnostic)]
let mut diag = self.tcx.sess.struct_allow("");
let mut diag = dcx.struct_allow("");
let msg = e.diagnostic_message();
e.add_args(dcx, &mut diag);
let s = dcx.eagerly_translate_to_string(msg, diag.args());