Skip to content

Commit 14d62c6

Browse files
Run MIR passes on promoted temporaries again.
1 parent 85eadf8 commit 14d62c6

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
@@ -148,6 +148,14 @@ fn run_suite<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
148148

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

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

0 commit comments

Comments
 (0)