about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/mod.rs
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_middle/src/ty/mod.rs
parent8ee4446ee5e1c23bef61b45f74e37db4bad2f424 (diff)
downloadrust-d7ea161b7e71f6a76868b1566bad31c1ca52824c.tar.gz
rust-d7ea161b7e71f6a76868b1566bad31c1ca52824c.zip
Remove DefId from AssocItemContainer.
Diffstat (limited to 'compiler/rustc_middle/src/ty/mod.rs')
-rw-r--r--compiler/rustc_middle/src/ty/mod.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs
index 96ce1fef77e..77c6c532f41 100644
--- a/compiler/rustc_middle/src/ty/mod.rs
+++ b/compiler/rustc_middle/src/ty/mod.rs
@@ -2194,10 +2194,7 @@ impl<'tcx> TyCtxt<'tcx> {
     /// If the given `DefId` describes a method belonging to an impl, returns the
     /// `DefId` of the impl that the method belongs to; otherwise, returns `None`.
     pub fn impl_of_method(self, def_id: DefId) -> Option<DefId> {
-        self.opt_associated_item(def_id).and_then(|trait_item| match trait_item.container {
-            TraitContainer(_) => None,
-            ImplContainer(def_id) => Some(def_id),
-        })
+        self.opt_associated_item(def_id).and_then(|trait_item| trait_item.impl_container(self))
     }
 
     /// If the given `DefId` belongs to a trait that was automatically derived, returns `true`.