@@ -13,8 +13,8 @@ use stable_mir::mir::mono::{InstanceDef, StaticDef};
1313use stable_mir:: mir:: Body ;
1414use stable_mir:: target:: { MachineInfo , MachineSize } ;
1515use stable_mir:: ty:: {
16- AdtDef , AdtKind , Allocation , ClosureDef , ClosureKind , Const , FieldDef , FnDef , GenericArgs ,
17- LineInfo , PolyFnSig , RigidTy , Span , Ty , TyKind , VariantDef ,
16+ AdtDef , AdtKind , Allocation , ClosureDef , ClosureKind , Const , FieldDef , FnDef , FnSig ,
17+ GenericArgs , LineInfo , PolyFnSig , RigidTy , Span , Ty , TyKind , VariantDef ,
1818} ;
1919use stable_mir:: { Crate , CrateItem , DefId , Error , Filename , ItemKind , Symbol } ;
2020use std:: cell:: RefCell ;
@@ -324,7 +324,16 @@ impl<'tcx> Context for TablesWrapper<'tcx> {
324324 fn instance_ty ( & self , def : InstanceDef ) -> stable_mir:: ty:: Ty {
325325 let mut tables = self . 0 . borrow_mut ( ) ;
326326 let instance = tables. instances [ def] ;
327- instance. ty ( tables. tcx , ParamEnv :: empty ( ) ) . stable ( & mut * tables)
327+ instance. ty ( tables. tcx , ParamEnv :: reveal_all ( ) ) . stable ( & mut * tables)
328+ }
329+
330+ fn instance_sig ( & self , def : InstanceDef ) -> FnSig {
331+ let mut tables = self . 0 . borrow_mut ( ) ;
332+ let instance = tables. instances [ def] ;
333+ let ty = instance. ty ( tables. tcx , ParamEnv :: reveal_all ( ) ) ;
334+ let sig = if ty. is_fn ( ) { ty. fn_sig ( tables. tcx ) } else { instance. args . as_closure ( ) . sig ( ) } ;
335+ // Erase late bound regions.
336+ tables. tcx . instantiate_bound_regions_with_erased ( sig) . stable ( & mut * tables)
328337 }
329338
330339 fn instance_def_id ( & self , def : InstanceDef ) -> stable_mir:: DefId {
0 commit comments