about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2022-01-28 15:13:01 -0300
committerSantiago Pastorino <spastorino@gmail.com>2022-01-28 15:13:01 -0300
commit5a299a9903abd6bd5161d610855b0c123ed58dfb (patch)
treeeda4fc583b9b8e1001d3e5947171cebc43faa210
parentd17eb78cf836610d8571806744785f1cbcbb6481 (diff)
Make local_def_id_to_hir_id return MaybeOwner<()>
-rw-r--r--compiler/rustc_middle/src/hir/mod.rs7
-rw-r--r--compiler/rustc_middle/src/query/mod.rs2
2 files changed, 2 insertions, 7 deletions
diff --git a/compiler/rustc_middle/src/hir/mod.rs b/compiler/rustc_middle/src/hir/mod.rs
index 16b41c8f9d1..12379eed80e 100644
--- a/compiler/rustc_middle/src/hir/mod.rs
+++ b/compiler/rustc_middle/src/hir/mod.rs
@@ -69,12 +69,7 @@ pub fn provide(providers: &mut Providers) {
         let node = owner.node();
         Some(Owner { node, hash_without_bodies: owner.nodes.hash_without_bodies })
     };
-    providers.local_def_id_to_hir_id = |tcx, id| {
-        tcx.hir_crate(()).owners[id].map(|owner| {
-            let node = owner.nodes.node();
-            Owner { node, hash_without_bodies: owner.nodes.hash_without_bodies }
-        })
-    };
+    providers.local_def_id_to_hir_id = |tcx, id| tcx.hir_crate(()).owners[id].map(|_| ());
     providers.hir_owner_nodes = |tcx, id| tcx.hir_crate(()).owners[id].map(|i| &i.nodes);
     providers.hir_owner_parent = |tcx, id| {
         // Accessing the def_key is ok since its value is hashed as part of `id`'s DefPathHash.
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs
index 2eadcc6c1d3..334e06aa685 100644
--- a/compiler/rustc_middle/src/query/mod.rs
+++ b/compiler/rustc_middle/src/query/mod.rs
@@ -60,7 +60,7 @@ rustc_queries! {
     ///
     /// This can be conveniently accessed by methods on `tcx.hir()`.
     /// Avoid calling this query directly.
-    query local_def_id_to_hir_id(key: LocalDefId) -> hir::MaybeOwner<crate::hir::Owner<'tcx>> {
+    query local_def_id_to_hir_id(key: LocalDefId) -> hir::MaybeOwner<()> {
         desc { |tcx| "HIR ID of `{}`", tcx.def_path_str(key.to_def_id()) }
     }