diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-09-22 19:28:20 +0200 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2022-01-27 10:46:40 -0300 |
| commit | a0bcce4884683cd3cb968f6cf6dd0d7720e9a6db (patch) | |
| tree | 5ce6029571ab576810aec2e0fbd62e9d25f312cd /compiler/rustc_middle/src/query | |
| parent | 009c1d02484dcc18e1596a33b3d8989a90361c89 (diff) | |
| download | rust-a0bcce4884683cd3cb968f6cf6dd0d7720e9a6db.tar.gz rust-a0bcce4884683cd3cb968f6cf6dd0d7720e9a6db.zip | |
Store def_id_to_hir_id as variant in hir_owner.
If hir_owner is Owner(_), the LocalDefId is pointing to an owner, so the ItemLocalId is 0. If the HIR node does not exist, we store Phantom. Otherwise, we store the HirId associated to the LocalDefId.
Diffstat (limited to 'compiler/rustc_middle/src/query')
| -rw-r--r-- | compiler/rustc_middle/src/query/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index 715a1fa25a1..f5b4925fbb3 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -52,7 +52,7 @@ rustc_queries! { /// /// This can be conveniently accessed by methods on `tcx.hir()`. /// Avoid calling this query directly. - query hir_owner(key: LocalDefId) -> Option<crate::hir::Owner<'tcx>> { + query hir_owner(key: LocalDefId) -> hir::MaybeOwner<crate::hir::Owner<'tcx>> { desc { |tcx| "HIR owner of `{}`", tcx.def_path_str(key.to_def_id()) } } @@ -68,7 +68,7 @@ rustc_queries! { /// /// This can be conveniently accessed by methods on `tcx.hir()`. /// Avoid calling this query directly. - query hir_owner_nodes(key: LocalDefId) -> Option<&'tcx hir::OwnerNodes<'tcx>> { + query hir_owner_nodes(key: LocalDefId) -> hir::MaybeOwner<&'tcx hir::OwnerNodes<'tcx>> { desc { |tcx| "HIR owner items in `{}`", tcx.def_path_str(key.to_def_id()) } } |
