Skip to content

Commit 13e7b23

Browse files
Add comments about stealing THIR in mir_build
1 parent 3f31044 commit 13e7b23

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_mir_build/src/build

1 file changed

+4
-0
lines changed

compiler/rustc_mir_build/src/build/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ fn mir_build(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> Body<'_
118118

119119
let body = tcx.hir().body(body_id);
120120
let (thir, expr) = tcx.thir_body(def);
121+
// We ran all queries that depended on THIR at the beginning
122+
// of `mir_build`, so now we can steal it
121123
let thir = thir.steal();
122124
let ty = tcx.type_of(fn_def_id);
123125
let mut abi = fn_sig.abi;
@@ -227,6 +229,8 @@ fn mir_build(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> Body<'_
227229
let return_ty = typeck_results.node_type(id);
228230

229231
let (thir, expr) = tcx.thir_body(def);
232+
// We ran all queries that depended on THIR at the beginning
233+
// of `mir_build`, so now we can steal it
230234
let thir = thir.steal();
231235

232236
build::construct_const(&thir, &infcx, expr, def, id, return_ty, return_ty_span)

0 commit comments

Comments
 (0)