interpret: fix vtable check debug assertion

This commit is contained in:
Ralf Jung 2022-07-22 10:37:03 -04:00
parent e7a9c11416
commit 19e29e9a57

View File

@ -589,13 +589,12 @@ pub(crate) fn eval_fn_call(
ty::ExistentialTraitRef::erase_self_ty(tcx, virtual_trait_ref);
let concrete_trait_ref = existential_trait_ref.with_self_ty(tcx, dyn_ty);
let concrete_method = Instance::resolve(
let concrete_method = Instance::resolve_for_vtable(
tcx,
self.param_env,
def_id,
instance.substs.rebase_onto(tcx, trait_def_id, concrete_trait_ref.substs),
)
.unwrap()
.unwrap();
assert_eq!(fn_inst, concrete_method);
}