Skip to content

Commit

Permalink
Add some comments to the new queries
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Mar 14, 2020
1 parent 31183c3 commit 14fdd85
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/librustc/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,33 @@ rustc_queries! {
desc { "get the crate HIR" }
}

// The indexed HIR. This can be conveniently accessed by `tcx.hir()`.
// Avoid calling this query directly.
query index_hir(_: CrateNum) -> &'tcx map::IndexedHir<'tcx> {
eval_always
no_hash
desc { "index HIR" }
}

// The items in a module.
// This can be conveniently accessed by `tcx.hir().visit_item_likes_in_module`.
// Avoid calling this query directly.
query hir_module_items(key: DefId) -> &'tcx hir::ModuleItems {
eval_always
}

// An HIR item with a `DefId` that can own other HIR items which do not themselves have
// a `DefId`.
// This can be conveniently accessed by methods on `tcx.hir()`.
// Avoid calling this query directly.
query hir_owner(key: DefId) -> &'tcx HirOwner<'tcx> {
eval_always
}

// The HIR items which do not themselves have a `DefId` and are owned by another HIR item
// with a `DefId`.
// This can be conveniently accessed by methods on `tcx.hir()`.
// Avoid calling this query directly.
query hir_owner_items(key: DefId) -> &'tcx HirOwnerItems<'tcx> {
eval_always
}
Expand Down

0 comments on commit 14fdd85

Please sign in to comment.