Remove RegionHighlightMode::tcx
.
It's easier to pass it in to the one method that needs it (`highlighting_region_vid`) than to store it in the type. This means `RegionHighlightMode` can impl `Default`.
This commit is contained in:
parent
203c57dbe2
commit
1281d43942
4 changed files with 18 additions and 23 deletions
|
@ -442,8 +442,8 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
|
|||
span: Span,
|
||||
counter: usize,
|
||||
) -> RegionNameHighlight {
|
||||
let mut highlight = RegionHighlightMode::new(self.infcx.tcx);
|
||||
highlight.highlighting_region_vid(needle_fr, counter);
|
||||
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;
|
||||
|
||||
|
@ -804,8 +804,8 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
|
|||
return None;
|
||||
}
|
||||
|
||||
let mut highlight = RegionHighlightMode::new(tcx);
|
||||
highlight.highlighting_region_vid(fr, *self.next_region_name.try_borrow().unwrap());
|
||||
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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue