Skip to content

Commit 5a299a9

Browse files
committed
Make local_def_id_to_hir_id return MaybeOwner<()>
1 parent d17eb78 commit 5a299a9

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

compiler/rustc_middle/src/hir/mod.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,7 @@ pub fn provide(providers: &mut Providers) {
6969
let node = owner.node();
7070
Some(Owner { node, hash_without_bodies: owner.nodes.hash_without_bodies })
7171
};
72-
providers.local_def_id_to_hir_id = |tcx, id| {
73-
tcx.hir_crate(()).owners[id].map(|owner| {
74-
let node = owner.nodes.node();
75-
Owner { node, hash_without_bodies: owner.nodes.hash_without_bodies }
76-
})
77-
};
72+
providers.local_def_id_to_hir_id = |tcx, id| tcx.hir_crate(()).owners[id].map(|_| ());
7873
providers.hir_owner_nodes = |tcx, id| tcx.hir_crate(()).owners[id].map(|i| &i.nodes);
7974
providers.hir_owner_parent = |tcx, id| {
8075
// Accessing the def_key is ok since its value is hashed as part of `id`'s DefPathHash.

compiler/rustc_middle/src/query/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ rustc_queries! {
6060
///
6161
/// This can be conveniently accessed by methods on `tcx.hir()`.
6262
/// Avoid calling this query directly.
63-
query local_def_id_to_hir_id(key: LocalDefId) -> hir::MaybeOwner<crate::hir::Owner<'tcx>> {
63+
query local_def_id_to_hir_id(key: LocalDefId) -> hir::MaybeOwner<()> {
6464
desc { |tcx| "HIR ID of `{}`", tcx.def_path_str(key.to_def_id()) }
6565
}
6666

0 commit comments

Comments
 (0)