diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2022-01-28 14:58:27 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2022-01-28 14:58:27 -0300 |
| commit | d17eb78cf836610d8571806744785f1cbcbb6481 (patch) | |
| tree | f49c33ed8338e4da1711facb101e73b565ed9311 /compiler/rustc_middle/src/query | |
| parent | a0bcce4884683cd3cb968f6cf6dd0d7720e9a6db (diff) | |
| download | rust-d17eb78cf836610d8571806744785f1cbcbb6481.tar.gz rust-d17eb78cf836610d8571806744785f1cbcbb6481.zip | |
Separate hir_owner query into two queries to avoid using extensive data on incr comp most of the time
Diffstat (limited to 'compiler/rustc_middle/src/query')
| -rw-r--r-- | compiler/rustc_middle/src/query/mod.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index f5b4925fbb3..2eadcc6c1d3 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -52,10 +52,18 @@ rustc_queries! { /// /// This can be conveniently accessed by methods on `tcx.hir()`. /// Avoid calling this query directly. - query hir_owner(key: LocalDefId) -> hir::MaybeOwner<crate::hir::Owner<'tcx>> { + query hir_owner(key: LocalDefId) -> Option<crate::hir::Owner<'tcx>> { desc { |tcx| "HIR owner of `{}`", tcx.def_path_str(key.to_def_id()) } } + /// Gives access to the HIR ID for the given `LocalDefId` owner `key`. + /// + /// 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>> { + desc { |tcx| "HIR ID of `{}`", tcx.def_path_str(key.to_def_id()) } + } + /// Gives access to the HIR node's parent for the HIR owner `key`. /// /// This can be conveniently accessed by methods on `tcx.hir()`. |
