1
Fork 0

Rollup merge of #119141 - celinval:smir-instance-args, r=compiler-errors

Add method to get instance instantiation arguments

Add a method to get the instance instantiation arguments, and include that information in the instance debug.
This commit is contained in:
Matthias Krüger 2023-12-20 21:18:59 +01:00 committed by GitHub
commit f6a04f693b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View file

@ -341,6 +341,12 @@ impl<'tcx> Context for TablesWrapper<'tcx> {
instance.ty(tables.tcx, ParamEnv::reveal_all()).stable(&mut *tables)
}
fn instance_args(&self, def: InstanceDef) -> GenericArgs {
let mut tables = self.0.borrow_mut();
let instance = tables.instances[def];
instance.args.stable(&mut *tables)
}
fn instance_abi(&self, def: InstanceDef) -> Result<FnAbi, Error> {
let mut tables = self.0.borrow_mut();
let instance = tables.instances[def];