Avoid wrapping a trivially defaultable type in Option
This commit is contained in:
parent
f387b9d909
commit
4032b9ddbd
3 changed files with 14 additions and 22 deletions
|
@ -459,11 +459,8 @@ 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
|
||||
.err_ctxt()
|
||||
.extract_inference_diagnostics_data(ty.into(), Some(highlight))
|
||||
.name;
|
||||
let type_name =
|
||||
self.infcx.err_ctxt().extract_inference_diagnostics_data(ty.into(), highlight).name;
|
||||
|
||||
debug!(
|
||||
"highlight_if_we_cannot_match_hir_ty: type_name={:?} needle_fr={:?}",
|
||||
|
@ -874,7 +871,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
|
|||
let type_name = self
|
||||
.infcx
|
||||
.err_ctxt()
|
||||
.extract_inference_diagnostics_data(yield_ty.into(), Some(highlight))
|
||||
.extract_inference_diagnostics_data(yield_ty.into(), highlight)
|
||||
.name;
|
||||
|
||||
let yield_span = match tcx.hir_node(self.mir_hir_id()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue