7373pub struct TypeBuilder < ' tcx > {
7474 tcx : mir_ty:: TyCtxt < ' tcx > ,
7575 def_ids : DefIdCache < ' tcx > ,
76- def_id : DefId ,
76+ owner_fn_id : DefId ,
7777 typing_env : mir_ty:: TypingEnv < ' tcx > ,
7878 type_params : Rc < RefCell < TypeParamMap > > ,
7979 system : Rc < RefCell < chc:: System > > ,
@@ -83,15 +83,16 @@ impl<'tcx> TypeBuilder<'tcx> {
8383 pub fn new (
8484 tcx : mir_ty:: TyCtxt < ' tcx > ,
8585 def_ids : DefIdCache < ' tcx > ,
86- def_id : DefId ,
86+ owner_fn_id : DefId ,
8787 type_params : Rc < RefCell < TypeParamMap > > ,
8888 system : Rc < RefCell < chc:: System > > ,
8989 ) -> Self {
90- let typing_env = mir_ty:: TypingEnv :: post_analysis ( tcx, def_id) ;
90+ tracing:: debug!( "TypeBuilder is created for {owner_fn_id:?}." ) ;
91+ let typing_env = mir_ty:: TypingEnv :: post_analysis ( tcx, owner_fn_id) ;
9192 Self {
9293 tcx,
9394 def_ids,
94- def_id ,
95+ owner_fn_id ,
9596 typing_env,
9697 type_params,
9798 system,
@@ -101,16 +102,29 @@ impl<'tcx> TypeBuilder<'tcx> {
101102 fn translate_param_type ( & self , ty : & mir_ty:: ParamTy ) -> rty:: Type < rty:: Closed > {
102103 let mut type_params = self . type_params . borrow_mut ( ) ;
103104 let index = type_params
104- . entry ( TypeParam :: GenericType ( self . def_id , ty. index ) )
105- . or_insert_with ( || self . system . borrow_mut ( ) . new_forall_sort ( ) ) ;
105+ . entry ( TypeParam :: GenericType ( self . owner_fn_id , ty. index ) )
106+ . or_insert_with ( || {
107+ let idx = self . system . borrow_mut ( ) . new_forall_sort ( ) ;
108+ tracing:: debug!(
109+ "issue the new ForallSortIdx {} for ParamTy {:?} at {:?}." ,
110+ idx,
111+ ty,
112+ self . owner_fn_id
113+ ) ;
114+ idx
115+ } ) ;
106116 rty:: ParamType :: new ( * index) . into ( )
107117 }
108118
109119 fn translate_alias_type ( & self , ty : & mir_ty:: AliasTy ) -> rty:: Type < rty:: Closed > {
110120 let mut type_params = self . type_params . borrow_mut ( ) ;
111121 let index = type_params
112122 . entry ( TypeParam :: AssocType ( ty. def_id ) )
113- . or_insert_with ( || self . system . borrow_mut ( ) . new_forall_sort ( ) ) ;
123+ . or_insert_with ( || {
124+ let idx = self . system . borrow_mut ( ) . new_forall_sort ( ) ;
125+ tracing:: debug!( "issue the new ForallSortIdx {} for AliasTy {:#?}." , idx, ty) ;
126+ idx
127+ } ) ;
114128 rty:: ParamType :: new ( * index) . into ( )
115129 }
116130
0 commit comments