Skip to content

Commit 0919f7c

Browse files
committed
rustc_mir: use self.resolve instead of Instance::resolve where possible.
1 parent ada6f1c commit 0919f7c

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/librustc_mir/interpret/cast.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
3939
if self.tcx.has_attr(def_id, sym::rustc_args_required_const) {
4040
bug!("reifying a fn ptr that requires const arguments");
4141
}
42-
let instance = ty::Instance::resolve(
43-
*self.tcx,
44-
self.param_env,
45-
def_id,
46-
substs,
47-
).ok_or_else(|| err_inval!(TooGeneric))?;
42+
let instance = self.resolve(def_id, substs)?;
4843
let fn_ptr = self.memory.create_fn_alloc(FnVal::Instance(instance));
4944
self.write_scalar(Scalar::Ptr(fn_ptr.into()), dest)?;
5045
}

0 commit comments

Comments
 (0)