@@ -8,7 +8,7 @@ use derive_where::derive_where;
88use rustc_macros:: { HashStable_NoContext , TyDecodable , TyEncodable } ;
99#[ cfg( feature = "nightly" ) ]
1010use rustc_serialize:: Decodable ;
11- use tracing:: debug ;
11+ use tracing:: instrument ;
1212
1313use crate :: data_structures:: SsoHashSet ;
1414use crate :: fold:: { FallibleTypeFolder , TypeFoldable , TypeFolder , TypeSuperFoldable } ;
@@ -831,28 +831,20 @@ impl<'a, I: Interner> ArgFolder<'a, I> {
831831 /// As indicated in the diagram, here the same type `&'a i32` is instantiated once, but in the
832832 /// first case we do not increase the De Bruijn index and in the second case we do. The reason
833833 /// 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) ]
834835 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-
842836 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 )
844840 }
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
850841 }
851842
852843 fn shift_region_through_binders ( & self , region : I :: Region ) -> I :: Region {
853844 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 )
855848 }
856- ty:: fold:: shift_region ( self . cx , region, self . binders_passed )
857849 }
858850}
0 commit comments