@@ -2460,7 +2460,12 @@ impl<'tcx> PrettyPrinter<'tcx> for FmtPrinter<'_, 'tcx> {
2460
2460
where
2461
2461
T : Print < ' tcx , Self > + TypeFoldable < TyCtxt < ' tcx > > ,
2462
2462
{
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 ( ( ) )
2464
2469
}
2465
2470
2466
2471
fn wrap_binder < T , C : FnOnce ( & T , & mut Self ) -> Result < ( ) , PrintError > > (
@@ -2472,7 +2477,12 @@ impl<'tcx> PrettyPrinter<'tcx> for FmtPrinter<'_, 'tcx> {
2472
2477
where
2473
2478
T : TypeFoldable < TyCtxt < ' tcx > > ,
2474
2479
{
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 ( ( ) )
2476
2486
}
2477
2487
2478
2488
fn typed_value (
@@ -2859,38 +2869,6 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
2859
2869
Ok ( ( new_value, map) )
2860
2870
}
2861
2871
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
-
2894
2872
fn prepare_region_info < T > ( & mut self , value : & ty:: Binder < ' tcx , T > )
2895
2873
where
2896
2874
T : TypeFoldable < TyCtxt < ' tcx > > ,
0 commit comments