Skip to content

Commit 14fdd85

Browse files
committed
Add some comments to the new queries
1 parent 31183c3 commit 14fdd85

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/librustc/query/mod.rs

+13
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,33 @@ rustc_queries! {
5555
desc { "get the crate HIR" }
5656
}
5757

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

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

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

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

0 commit comments

Comments
 (0)