Separate hir_owner query into two queries to avoid using extensive data on incr comp most of the time
This commit is contained in:
parent
a0bcce4884
commit
d17eb78cf8
3 changed files with 29 additions and 16 deletions
|
@ -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()`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue