Skip to content

Commit acad574

Browse files
committed
Elaborate docs on the promoted_mir query
1 parent 39a114e commit acad574

File tree

1 file changed

+4
-1
lines changed
  • src/librustc_middle/query

1 file changed

+4
-1
lines changed

src/librustc_middle/query/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,10 @@ rustc_queries! {
282282
}
283283

284284
/// The `DefId` is the `DefId` of the containing MIR body. Promoteds to not have their own
285-
/// `DefId`.
285+
/// `DefId`. This function returns all promoteds in the specified body. The body references
286+
/// promoteds by the `DefId` and the `mir::Promoted` index. This is necessary, because
287+
/// after inlining a body may refer to promoteds from other bodies. In that case you still
288+
/// need to use the `DefId` of the original body.
286289
query promoted_mir(key: DefId) -> &'tcx IndexVec<mir::Promoted, mir::Body<'tcx>> {
287290
desc { |tcx| "optimizing promoted MIR for `{}`", tcx.def_path_str(key) }
288291
cache_on_disk_if { key.is_local() }

0 commit comments

Comments
 (0)