about summary refs log tree commit diff
path: root/compiler/rustc_const_eval
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-03-13 00:52:25 +0100
committerCamille GILLOT <gillot.camille@gmail.com>2022-08-01 21:38:45 +0200
commitd7ea161b7e71f6a76868b1566bad31c1ca52824c (patch)
treef54e79e0433cf00d8ef7b48dbec3491f94f4c073 /compiler/rustc_const_eval
parent8ee4446ee5e1c23bef61b45f74e37db4bad2f424 (diff)
downloadrust-d7ea161b7e71f6a76868b1566bad31c1ca52824c.tar.gz
rust-d7ea161b7e71f6a76868b1566bad31c1ca52824c.zip
Remove DefId from AssocItemContainer.
Diffstat (limited to 'compiler/rustc_const_eval')
-rw-r--r--compiler/rustc_const_eval/src/util/call_kind.rs9
1 files changed, 6 insertions, 3 deletions
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<Ident>,
 ) -> 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