@@ -2460,7 +2460,12 @@ impl<'tcx> PrettyPrinter<'tcx> for FmtPrinter<'_, 'tcx> {
24602460 where
24612461 T : Print < ' tcx , Self > + TypeFoldable < TyCtxt < ' tcx > > ,
24622462 {
2463- self . pretty_print_in_binder ( value)
2463+ let old_region_index = self . region_index ;
2464+ let ( new_value, _) = self . name_all_regions ( value, WrapBinderMode :: ForAll ) ?;
2465+ new_value. print ( self ) ?;
2466+ self . region_index = old_region_index;
2467+ self . binder_depth -= 1 ;
2468+ Ok ( ( ) )
24642469 }
24652470
24662471 fn wrap_binder < T , C : FnOnce ( & T , & mut Self ) -> Result < ( ) , PrintError > > (
@@ -2472,7 +2477,12 @@ impl<'tcx> PrettyPrinter<'tcx> for FmtPrinter<'_, 'tcx> {
24722477 where
24732478 T : TypeFoldable < TyCtxt < ' tcx > > ,
24742479 {
2475- self . pretty_wrap_binder ( value, mode, f)
2480+ let old_region_index = self . region_index ;
2481+ let ( new_value, _) = self . name_all_regions ( value, mode) ?;
2482+ f ( & new_value, self ) ?;
2483+ self . region_index = old_region_index;
2484+ self . binder_depth -= 1 ;
2485+ Ok ( ( ) )
24762486 }
24772487
24782488 fn typed_value (
@@ -2859,38 +2869,6 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
28592869 Ok ( ( new_value, map) )
28602870 }
28612871
2862- pub fn pretty_print_in_binder < T > (
2863- & mut self ,
2864- value : & ty:: Binder < ' tcx , T > ,
2865- ) -> Result < ( ) , fmt:: Error >
2866- where
2867- T : Print < ' tcx , Self > + TypeFoldable < TyCtxt < ' tcx > > ,
2868- {
2869- let old_region_index = self . region_index ;
2870- let ( new_value, _) = self . name_all_regions ( value, WrapBinderMode :: ForAll ) ?;
2871- new_value. print ( self ) ?;
2872- self . region_index = old_region_index;
2873- self . binder_depth -= 1 ;
2874- Ok ( ( ) )
2875- }
2876-
2877- pub fn pretty_wrap_binder < T , C : FnOnce ( & T , & mut Self ) -> Result < ( ) , fmt:: Error > > (
2878- & mut self ,
2879- value : & ty:: Binder < ' tcx , T > ,
2880- mode : WrapBinderMode ,
2881- f : C ,
2882- ) -> Result < ( ) , fmt:: Error >
2883- where
2884- T : TypeFoldable < TyCtxt < ' tcx > > ,
2885- {
2886- let old_region_index = self . region_index ;
2887- let ( new_value, _) = self . name_all_regions ( value, mode) ?;
2888- f ( & new_value, self ) ?;
2889- self . region_index = old_region_index;
2890- self . binder_depth -= 1 ;
2891- Ok ( ( ) )
2892- }
2893-
28942872 fn prepare_region_info < T > ( & mut self , value : & ty:: Binder < ' tcx , T > )
28952873 where
28962874 T : TypeFoldable < TyCtxt < ' tcx > > ,
0 commit comments