hir: Simplify hir_owner_nodes
query
The query accept arbitrary DefIds, not just owner DefIds. The return can be an `Option` because if there are no nodes, then it doesn't matter whether it's due to NonOwner or Phantom. Also rename the query to `opt_hir_owner_nodes`.
This commit is contained in:
parent
c401f09979
commit
64b6b5b6ce
40 changed files with 862 additions and 867 deletions
|
@ -190,11 +190,11 @@ rustc_queries! {
|
|||
desc { |tcx| "getting HIR parent of `{}`", tcx.def_path_str(key) }
|
||||
}
|
||||
|
||||
/// Gives access to the HIR nodes and bodies inside the HIR owner `key`.
|
||||
/// Gives access to the HIR nodes and bodies inside `key` if it's a HIR owner.
|
||||
///
|
||||
/// This can be conveniently accessed by methods on `tcx.hir()`.
|
||||
/// Avoid calling this query directly.
|
||||
query hir_owner_nodes(key: hir::OwnerId) -> hir::MaybeOwner<&'tcx hir::OwnerNodes<'tcx>> {
|
||||
query opt_hir_owner_nodes(key: LocalDefId) -> Option<&'tcx hir::OwnerNodes<'tcx>> {
|
||||
desc { |tcx| "getting HIR owner items in `{}`", tcx.def_path_str(key) }
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue