@@ -279,7 +279,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
279279 pub fn extract_inference_diagnostics_data (
280280 & self ,
281281 arg : GenericArg < ' tcx > ,
282- highlight : Option < ty:: print:: RegionHighlightMode < ' tcx > > ,
282+ highlight : ty:: print:: RegionHighlightMode < ' tcx > ,
283283 ) -> InferenceDiagnosticsData {
284284 match arg. unpack ( ) {
285285 GenericArgKind :: Type ( ty) => {
@@ -301,9 +301,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
301301 }
302302
303303 let mut printer = ty:: print:: FmtPrinter :: new ( self . tcx , Namespace :: TypeNS ) ;
304- if let Some ( highlight) = highlight {
305- printer. region_highlight_mode = highlight;
306- }
304+ printer. region_highlight_mode = highlight;
305+
307306 ty. print ( & mut printer) . unwrap ( ) ;
308307 InferenceDiagnosticsData {
309308 name : printer. into_buffer ( ) ,
@@ -326,9 +325,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
326325
327326 debug_assert ! ( !origin. span. is_dummy( ) ) ;
328327 let mut printer = ty:: print:: FmtPrinter :: new ( self . tcx , Namespace :: ValueNS ) ;
329- if let Some ( highlight) = highlight {
330- printer. region_highlight_mode = highlight;
331- }
328+ printer. region_highlight_mode = highlight;
329+
332330 ct. print ( & mut printer) . unwrap ( ) ;
333331 InferenceDiagnosticsData {
334332 name : printer. into_buffer ( ) ,
@@ -344,9 +342,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
344342 // to figure out which inference var is actually unresolved so that
345343 // this path is unreachable.
346344 let mut printer = ty:: print:: FmtPrinter :: new ( self . tcx , Namespace :: ValueNS ) ;
347- if let Some ( highlight) = highlight {
348- printer. region_highlight_mode = highlight;
349- }
345+ printer. region_highlight_mode = highlight;
346+
350347 ct. print ( & mut printer) . unwrap ( ) ;
351348 InferenceDiagnosticsData {
352349 name : printer. into_buffer ( ) ,
@@ -422,7 +419,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
422419 should_label_span : bool ,
423420 ) -> Diag < ' a > {
424421 let arg = self . resolve_vars_if_possible ( arg) ;
425- let arg_data = self . extract_inference_diagnostics_data ( arg, None ) ;
422+ let arg_data =
423+ self . extract_inference_diagnostics_data ( arg, ty:: print:: RegionHighlightMode :: default ( ) ) ;
426424
427425 let Some ( typeck_results) = & self . typeck_results else {
428426 // If we don't have any typeck results we're outside
0 commit comments