@@ -13,8 +13,8 @@ use stable_mir::mir::mono::{InstanceDef, StaticDef};
13
13
use stable_mir:: mir:: Body ;
14
14
use stable_mir:: target:: { MachineInfo , MachineSize } ;
15
15
use 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 ,
18
18
} ;
19
19
use stable_mir:: { Crate , CrateItem , DefId , Error , Filename , ItemKind , Symbol } ;
20
20
use std:: cell:: RefCell ;
@@ -324,7 +324,16 @@ impl<'tcx> Context for TablesWrapper<'tcx> {
324
324
fn instance_ty ( & self , def : InstanceDef ) -> stable_mir:: ty:: Ty {
325
325
let mut tables = self . 0 . borrow_mut ( ) ;
326
326
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)
328
337
}
329
338
330
339
fn instance_def_id ( & self , def : InstanceDef ) -> stable_mir:: DefId {
0 commit comments