@@ -283,6 +283,8 @@ pub trait PrettyPrinter<'tcx>:
283
283
/// This is typically the case for all non-`'_` regions.
284
284
fn should_print_region ( & self , region : ty:: Region < ' tcx > ) -> bool ;
285
285
286
+ fn reset_type_limit ( & mut self ) { }
287
+
286
288
// Defaults (should not be overridden):
287
289
288
290
/// If possible, this returns a global path resolving to `def_id` that is visible
@@ -1981,6 +1983,10 @@ impl<'tcx> PrettyPrinter<'tcx> for FmtPrinter<'_, 'tcx> {
1981
1983
self . 0 . ty_infer_name_resolver . as_ref ( ) . and_then ( |func| func ( id) )
1982
1984
}
1983
1985
1986
+ fn reset_type_limit ( & mut self ) {
1987
+ self . printed_type_count = 0 ;
1988
+ }
1989
+
1984
1990
fn const_infer_name ( & self , id : ty:: ConstVid < ' tcx > ) -> Option < Symbol > {
1985
1991
self . 0 . const_infer_name_resolver . as_ref ( ) . and_then ( |func| func ( id) )
1986
1992
}
@@ -2722,11 +2728,15 @@ define_print_and_forward_display! {
2722
2728
}
2723
2729
2724
2730
ty:: SubtypePredicate <' tcx> {
2725
- p!( print( self . a) , " <: " , print( self . b) )
2731
+ p!( print( self . a) , " <: " ) ;
2732
+ cx. reset_type_limit( ) ;
2733
+ p!( print( self . b) )
2726
2734
}
2727
2735
2728
2736
ty:: CoercePredicate <' tcx> {
2729
- p!( print( self . a) , " -> " , print( self . b) )
2737
+ p!( print( self . a) , " -> " ) ;
2738
+ cx. reset_type_limit( ) ;
2739
+ p!( print( self . b) )
2730
2740
}
2731
2741
2732
2742
ty:: TraitPredicate <' tcx> {
@@ -2738,7 +2748,9 @@ define_print_and_forward_display! {
2738
2748
}
2739
2749
2740
2750
ty:: ProjectionPredicate <' tcx> {
2741
- p!( print( self . projection_ty) , " == " , print( self . term) )
2751
+ p!( print( self . projection_ty) , " == " ) ;
2752
+ cx. reset_type_limit( ) ;
2753
+ p!( print( self . term) )
2742
2754
}
2743
2755
2744
2756
ty:: Term <' tcx> {
0 commit comments