From 19e29e9a5750c744926a491238e6c80e8a929988 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 22 Jul 2022 10:37:03 -0400 Subject: [PATCH] interpret: fix vtable check debug assertion --- compiler/rustc_const_eval/src/interpret/terminator.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_const_eval/src/interpret/terminator.rs b/compiler/rustc_const_eval/src/interpret/terminator.rs index e7e60b5fa23..6fef7b3b3cf 100644 --- a/compiler/rustc_const_eval/src/interpret/terminator.rs +++ b/compiler/rustc_const_eval/src/interpret/terminator.rs @@ -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); }