From d7ea161b7e71f6a76868b1566bad31c1ca52824c Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sun, 13 Mar 2022 00:52:25 +0100 Subject: Remove DefId from AssocItemContainer. --- compiler/rustc_const_eval/src/util/call_kind.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'compiler/rustc_const_eval') diff --git a/compiler/rustc_const_eval/src/util/call_kind.rs b/compiler/rustc_const_eval/src/util/call_kind.rs index a7a480dd1d7..af9d83f0609 100644 --- a/compiler/rustc_const_eval/src/util/call_kind.rs +++ b/compiler/rustc_const_eval/src/util/call_kind.rs @@ -66,9 +66,12 @@ pub fn call_kind<'tcx>( from_hir_call: bool, self_arg: Option, ) -> CallKind<'tcx> { - let parent = tcx.opt_associated_item(method_did).and_then(|assoc| match assoc.container { - AssocItemContainer::ImplContainer(impl_did) => tcx.trait_id_of_impl(impl_did), - AssocItemContainer::TraitContainer(trait_did) => Some(trait_did), + let parent = tcx.opt_associated_item(method_did).and_then(|assoc| { + let container_id = assoc.container_id(tcx); + match assoc.container { + AssocItemContainer::ImplContainer => tcx.trait_id_of_impl(container_id), + AssocItemContainer::TraitContainer => Some(container_id), + } }); let fn_call = parent -- cgit 1.4.1-3-g733a5