@@ -2456,7 +2456,12 @@ impl<'tcx> PrettyPrinter<'tcx> for FmtPrinter<'_, 'tcx> {
2456
2456
where
2457
2457
T : Print < ' tcx , Self > + TypeFoldable < TyCtxt < ' tcx > > ,
2458
2458
{
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 ( ( ) )
2460
2465
}
2461
2466
2462
2467
fn wrap_binder < T , C : FnOnce ( & T , & mut Self ) -> Result < ( ) , PrintError > > (
@@ -2468,7 +2473,12 @@ impl<'tcx> PrettyPrinter<'tcx> for FmtPrinter<'_, 'tcx> {
2468
2473
where
2469
2474
T : TypeFoldable < TyCtxt < ' tcx > > ,
2470
2475
{
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 ( ( ) )
2472
2482
}
2473
2483
2474
2484
fn typed_value (
@@ -2855,38 +2865,6 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
2855
2865
Ok ( ( new_value, map) )
2856
2866
}
2857
2867
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
-
2890
2868
fn prepare_region_info < T > ( & mut self , value : & ty:: Binder < ' tcx , T > )
2891
2869
where
2892
2870
T : TypeFoldable < TyCtxt < ' tcx > > ,
0 commit comments