tcx.alloc_steal_mir(body)
}
-fn mir_validated(tcx: TyCtxt<'tcx>, def_id: DefId) -> (&'tcx Steal<Body<'tcx>>, &'tcx Steal<IndexVec<Promoted, Body<'tcx>>>) {
+fn mir_validated(
+ tcx: TyCtxt<'tcx>,
+ def_id: DefId,
+) -> (&'tcx Steal<Body<'tcx>>, &'tcx Steal<IndexVec<Promoted, Body<'tcx>>>) {
let hir_id = tcx.hir().as_local_hir_id(def_id).unwrap();
if let hir::BodyOwnerKind::Const = tcx.hir().body_owner_kind(hir_id) {
// Ensure that we compute the `mir_const_qualif` for constants at
&qualify_and_promote_pass,
&simplify::SimplifyCfg::new("qualify-consts"),
]);
- let promoted = qualify_and_promote_pass.promoted.into_inner();
- (tcx.alloc_steal_mir(body), tcx.alloc_steal_promoted(promoted.unwrap_or_else(|| IndexVec::new())))
+ let promoted =
+ qualify_and_promote_pass.promoted.into_inner().unwrap_or_else(|| IndexVec::new());
+ (tcx.alloc_steal_mir(body), tcx.alloc_steal_promoted(promoted))
}
fn optimized_mir(tcx: TyCtxt<'_>, def_id: DefId) -> &Body<'_> {