about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2021-10-21 19:41:47 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2022-01-15 21:26:20 +0100
commit60064726aee0d05c41bf6ff0eac4699f47762b05 (patch)
tree95a007dacbbc0339549ba1c86805281627eb1bc3 /compiler/rustc_ty_utils/src
parent5a123c265b7bf47fb7894c9e338f531fb463b4d8 (diff)
downloadrust-60064726aee0d05c41bf6ff0eac4699f47762b05.tar.gz
rust-60064726aee0d05c41bf6ff0eac4699f47762b05.zip
Return a LocalDefId in get_parent_item.
Diffstat (limited to 'compiler/rustc_ty_utils/src')
-rw-r--r--compiler/rustc_ty_utils/src/assoc.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_ty_utils/src/assoc.rs b/compiler/rustc_ty_utils/src/assoc.rs
index 6e2ef27f108..781a639b09e 100644
--- a/compiler/rustc_ty_utils/src/assoc.rs
+++ b/compiler/rustc_ty_utils/src/assoc.rs
@@ -52,8 +52,7 @@ fn trait_of_item(tcx: TyCtxt<'_>, def_id: DefId) -> Option<DefId> {
 
 fn associated_item(tcx: TyCtxt<'_>, def_id: DefId) -> ty::AssocItem {
     let id = tcx.hir().local_def_id_to_hir_id(def_id.expect_local());
-    let parent_id = tcx.hir().get_parent_item(id);
-    let parent_def_id = tcx.hir().local_def_id(parent_id);
+    let parent_def_id = tcx.hir().get_parent_item(id);
     let parent_item = tcx.hir().expect_item(parent_def_id);
     match parent_item.kind {
         hir::ItemKind::Impl(ref impl_) => {