Skip to content

Commit 24c18c4

Browse files
committed
Document HIR queries.
1 parent 8e92278 commit 24c18c4

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

compiler/rustc_middle/src/queries.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ rustc_queries! {
180180
}
181181

182182
query resolver_for_lowering_raw(_: ()) -> (
183+
// Those two fields are consumed by `index_ast`.
184+
// We want them to be eventually dropped after lowering.
183185
&'tcx Steal<ty::ResolverAstLowering<'tcx>>,
184186
&'tcx Steal<ast::Crate>,
185187
&'tcx ty::ResolverGlobalCtxt,
@@ -190,6 +192,9 @@ rustc_queries! {
190192
}
191193

192194
query index_ast(_: ()) -> &'tcx IndexVec<LocalDefId, Steal<(
195+
// There is only a single `ResolverAstLowering` for all owners.
196+
// We want to drop it once the whole HIR has been lowered.
197+
// We rely on reference counting to know when all definitions have been stolen.
193198
Arc<ty::ResolverAstLowering<'tcx>>,
194199
ast::AstOwner,
195200
)>> {
@@ -210,9 +215,9 @@ rustc_queries! {
210215
desc { "getting the source span" }
211216
}
212217

213-
query lower_to_hir(key: LocalDefId) -> hir::MaybeOwner<'tcx> {
218+
query lower_to_hir(def_id: LocalDefId) -> hir::MaybeOwner<'tcx> {
214219
eval_always
215-
desc { "lowering HIR for `{}`", tcx.def_path_str(key.to_def_id()) }
220+
desc { "lowering HIR for `{}`", tcx.def_path_str(def_id) }
216221
}
217222

218223
query hir_owner(def_id: LocalDefId) -> rustc_middle::hir::ProjectedMaybeOwner<'tcx> {

0 commit comments

Comments
 (0)