Introduce a hir_owner_parent query.

This commit is contained in:
Camille GILLOT 2021-03-06 11:25:41 +01:00
parent 18bffdb10e
commit d794cb0d4f
3 changed files with 14 additions and 2 deletions

View file

@ -52,6 +52,15 @@ rustc_queries! {
desc { |tcx| "HIR owner 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()`.
/// Avoid calling this query directly.
query hir_owner_parent(key: LocalDefId) -> hir::HirId {
eval_always
desc { |tcx| "HIR parent of `{}`", tcx.def_path_str(key.to_def_id()) }
}
/// Gives access to the HIR nodes and bodies inside the HIR owner `key`.
///
/// This can be conveniently accessed by methods on `tcx.hir()`.