@@ -2456,7 +2456,12 @@ impl<'tcx> PrettyPrinter<'tcx> for FmtPrinter<'_, 'tcx> {
24562456 where
24572457 T : Print < ' tcx , Self > + TypeFoldable < TyCtxt < ' tcx > > ,
24582458 {
2459- self . pretty_print_in_binder ( value)
2459+ let old_region_index = self . region_index ;
2460+ let ( new_value, _) = self . name_all_regions ( value, WrapBinderMode :: ForAll ) ?;
2461+ new_value. print ( self ) ?;
2462+ self . region_index = old_region_index;
2463+ self . binder_depth -= 1 ;
2464+ Ok ( ( ) )
24602465 }
24612466
24622467 fn wrap_binder < T , C : FnOnce ( & T , & mut Self ) -> Result < ( ) , PrintError > > (
@@ -2468,7 +2473,12 @@ impl<'tcx> PrettyPrinter<'tcx> for FmtPrinter<'_, 'tcx> {
24682473 where
24692474 T : TypeFoldable < TyCtxt < ' tcx > > ,
24702475 {
2471- self . pretty_wrap_binder ( value, mode, f)
2476+ let old_region_index = self . region_index ;
2477+ let ( new_value, _) = self . name_all_regions ( value, mode) ?;
2478+ f ( & new_value, self ) ?;
2479+ self . region_index = old_region_index;
2480+ self . binder_depth -= 1 ;
2481+ Ok ( ( ) )
24722482 }
24732483
24742484 fn typed_value (
@@ -2855,38 +2865,6 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
28552865 Ok ( ( new_value, map) )
28562866 }
28572867
2858- pub fn pretty_print_in_binder < T > (
2859- & mut self ,
2860- value : & ty:: Binder < ' tcx , T > ,
2861- ) -> Result < ( ) , fmt:: Error >
2862- where
2863- T : Print < ' tcx , Self > + TypeFoldable < TyCtxt < ' tcx > > ,
2864- {
2865- let old_region_index = self . region_index ;
2866- let ( new_value, _) = self . name_all_regions ( value, WrapBinderMode :: ForAll ) ?;
2867- new_value. print ( self ) ?;
2868- self . region_index = old_region_index;
2869- self . binder_depth -= 1 ;
2870- Ok ( ( ) )
2871- }
2872-
2873- pub fn pretty_wrap_binder < T , C : FnOnce ( & T , & mut Self ) -> Result < ( ) , fmt:: Error > > (
2874- & mut self ,
2875- value : & ty:: Binder < ' tcx , T > ,
2876- mode : WrapBinderMode ,
2877- f : C ,
2878- ) -> Result < ( ) , fmt:: Error >
2879- where
2880- T : TypeFoldable < TyCtxt < ' tcx > > ,
2881- {
2882- let old_region_index = self . region_index ;
2883- let ( new_value, _) = self . name_all_regions ( value, mode) ?;
2884- f ( & new_value, self ) ?;
2885- self . region_index = old_region_index;
2886- self . binder_depth -= 1 ;
2887- Ok ( ( ) )
2888- }
2889-
28902868 fn prepare_region_info < T > ( & mut self , value : & ty:: Binder < ' tcx , T > )
28912869 where
28922870 T : TypeFoldable < TyCtxt < ' tcx > > ,
0 commit comments