1
Fork 0

Move some stuff to TypeErrCtxt

This commit is contained in:
Michael Goulet 2024-07-21 14:06:24 -04:00
parent 0f8534e79e
commit fc1e7ceb4b
8 changed files with 31 additions and 27 deletions

View file

@ -457,8 +457,11 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, '_, 'tcx> {
) -> RegionNameHighlight {
let mut highlight = RegionHighlightMode::default();
highlight.highlighting_region_vid(self.infcx.tcx, needle_fr, counter);
let type_name =
self.infcx.extract_inference_diagnostics_data(ty.into(), Some(highlight)).name;
let type_name = self
.infcx
.err_ctxt()
.extract_inference_diagnostics_data(ty.into(), Some(highlight))
.name;
debug!(
"highlight_if_we_cannot_match_hir_ty: type_name={:?} needle_fr={:?}",
@ -872,8 +875,11 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, '_, 'tcx> {
let mut highlight = RegionHighlightMode::default();
highlight.highlighting_region_vid(tcx, fr, *self.next_region_name.try_borrow().unwrap());
let type_name =
self.infcx.extract_inference_diagnostics_data(yield_ty.into(), Some(highlight)).name;
let type_name = self
.infcx
.err_ctxt()
.extract_inference_diagnostics_data(yield_ty.into(), Some(highlight))
.name;
let yield_span = match tcx.hir_node(self.mir_hir_id()) {
hir::Node::Expr(hir::Expr {