Make local_def_id_to_hir_id return MaybeOwner<()>
This commit is contained in:
parent
d17eb78cf8
commit
5a299a9903
2 changed files with 2 additions and 7 deletions
|
@ -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.
|
||||
|
|
|
@ -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()) }
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue