mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-05 13:13:40 +00:00
rustc_mir: use self.resolve instead of Instance::resolve where possible.
This commit is contained in:
parent
ada6f1cd3d
commit
0919f7c3a3
@ -39,12 +39,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
if self.tcx.has_attr(def_id, sym::rustc_args_required_const) {
|
||||
bug!("reifying a fn ptr that requires const arguments");
|
||||
}
|
||||
let instance = ty::Instance::resolve(
|
||||
*self.tcx,
|
||||
self.param_env,
|
||||
def_id,
|
||||
substs,
|
||||
).ok_or_else(|| err_inval!(TooGeneric))?;
|
||||
let instance = self.resolve(def_id, substs)?;
|
||||
let fn_ptr = self.memory.create_fn_alloc(FnVal::Instance(instance));
|
||||
self.write_scalar(Scalar::Ptr(fn_ptr.into()), dest)?;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user