about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src
diff options
context:
space:
mode:
authorOli Scherer <github333195615777966@oli-obk.de>2024-12-16 15:30:03 +0000
committerOli Scherer <github333195615777966@oli-obk.de>2024-12-16 16:02:05 +0000
commit4032b9ddbd9f386cc55c3d76000461a1dbb76cd9 (patch)
treea4e46aa2868cd30507659ac00e4f963aed41632c /compiler/rustc_borrowck/src
parentf387b9d9092829c036684242f20b773549c90237 (diff)
downloadrust-4032b9ddbd9f386cc55c3d76000461a1dbb76cd9.tar.gz
rust-4032b9ddbd9f386cc55c3d76000461a1dbb76cd9.zip
Avoid wrapping a trivially defaultable type in `Option`
Diffstat (limited to 'compiler/rustc_borrowck/src')
-rw-r--r--compiler/rustc_borrowck/src/diagnostics/region_name.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/rustc_borrowck/src/diagnostics/region_name.rs b/compiler/rustc_borrowck/src/diagnostics/region_name.rs
index d49dee85144..5dfc2658d2a 100644
--- a/compiler/rustc_borrowck/src/diagnostics/region_name.rs
+++ b/compiler/rustc_borrowck/src/diagnostics/region_name.rs
@@ -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()) {