@@ -8,7 +8,7 @@ use derive_where::derive_where;
8
8
use rustc_macros:: { HashStable_NoContext , TyDecodable , TyEncodable } ;
9
9
#[ cfg( feature = "nightly" ) ]
10
10
use rustc_serialize:: Decodable ;
11
- use tracing:: debug ;
11
+ use tracing:: instrument ;
12
12
13
13
use crate :: data_structures:: SsoHashSet ;
14
14
use crate :: fold:: { FallibleTypeFolder , TypeFoldable , TypeFolder , TypeSuperFoldable } ;
@@ -831,28 +831,20 @@ impl<'a, I: Interner> ArgFolder<'a, I> {
831
831
/// As indicated in the diagram, here the same type `&'a i32` is instantiated once, but in the
832
832
/// first case we do not increase the De Bruijn index and in the second case we do. The reason
833
833
/// is that only in the second case have we passed through a fn binder.
834
+ #[ instrument( level = "trace" , skip( self ) , fields( binders_passed = self . binders_passed) , ret) ]
834
835
fn shift_vars_through_binders < T : TypeFoldable < I > > ( & self , val : T ) -> T {
835
- debug ! (
836
- "shift_vars(val={:?}, binders_passed={:?}, has_escaping_bound_vars={:?})" ,
837
- val,
838
- self . binders_passed,
839
- val. has_escaping_bound_vars( )
840
- ) ;
841
-
842
836
if self . binders_passed == 0 || !val. has_escaping_bound_vars ( ) {
843
- return val;
837
+ val
838
+ } else {
839
+ ty:: fold:: shift_vars ( self . cx , val, self . binders_passed )
844
840
}
845
-
846
- let result = ty:: fold:: shift_vars ( TypeFolder :: cx ( self ) , val, self . binders_passed ) ;
847
- debug ! ( "shift_vars: shifted result = {:?}" , result) ;
848
-
849
- result
850
841
}
851
842
852
843
fn shift_region_through_binders ( & self , region : I :: Region ) -> I :: Region {
853
844
if self . binders_passed == 0 || !region. has_escaping_bound_vars ( ) {
854
- return region;
845
+ region
846
+ } else {
847
+ ty:: fold:: shift_region ( self . cx , region, self . binders_passed )
855
848
}
856
- ty:: fold:: shift_region ( self . cx , region, self . binders_passed )
857
849
}
858
850
}
0 commit comments