Skip to content

Commit dd39ecf

Browse files
committed
Auto merge of rust-lang#43902 - michaelwoerister:fix-mir-passes-promoted, r=arielb1
Run MIR passes on promoted temporaries again. This seems to have been broken some time in the past (maybe here: rust-lang@9c154a6#diff-2f8e8805126c84b2be3f0967ffa0af28L162). r? @arielb1
2 parents a7e0018 + 14d62c6 commit dd39ecf

File tree

1 file changed

+8
-0
lines changed
  • src/librustc_mir/transform

1 file changed

+8
-0
lines changed

src/librustc_mir/transform/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ fn run_suite<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
149149

150150
pass.run_pass(tcx, source, mir);
151151

152+
for (index, promoted_mir) in mir.promoted.iter_enumerated_mut() {
153+
let promoted_source = MirSource::Promoted(source.item_id(), index);
154+
pass.run_pass(tcx, promoted_source, promoted_mir);
155+
156+
// Let's make sure we don't miss any nested instances
157+
assert!(promoted_mir.promoted.is_empty());
158+
}
159+
152160
for hook in tcx.mir_passes.hooks() {
153161
hook.on_mir_pass(tcx, suite, pass_num, &pass.name(), source, &mir, true);
154162
}

0 commit comments

Comments
 (0)