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

@ -79,7 +79,7 @@ fn resolve_associated_item<'tcx>(
let vtbl = match tcx.codegen_select_candidate((param_env, trait_ref)) {
Ok(vtbl) => vtbl,
Err(CodegenObligationError::Ambiguity) => {
let reported = tcx.sess.span_delayed_bug(
let reported = tcx.dcx().span_delayed_bug(
tcx.def_span(trait_item_id),
format!(
"encountered ambiguity selecting `{trait_ref:?}` during codegen, presuming due to \
@ -171,7 +171,7 @@ fn resolve_associated_item<'tcx>(
// Any final impl is required to define all associated items.
if !leaf_def.item.defaultness(tcx).has_value() {
let guard = tcx.sess.span_delayed_bug(
let guard = tcx.dcx().span_delayed_bug(
tcx.def_span(leaf_def.item.def_id),
"missing value for assoc item in impl",
);
@ -241,7 +241,7 @@ fn resolve_associated_item<'tcx>(
args: rcvr_args,
})
} else {
tcx.sess.emit_fatal(UnexpectedFnPtrAssociatedItem {
tcx.dcx().emit_fatal(UnexpectedFnPtrAssociatedItem {
span: tcx.def_span(trait_item_id),
})
}