Skip to content

Commit

Permalink
Auto merge of #43902 - michaelwoerister:fix-mir-passes-promoted, r=ar…
Browse files Browse the repository at this point in the history
…ielb1

Run MIR passes on promoted temporaries again.

This seems to have been broken some time in the past (maybe here: 9c154a6#diff-2f8e8805126c84b2be3f0967ffa0af28L162).

r? @arielb1
  • Loading branch information
bors committed Aug 17, 2017
2 parents a7e0018 + 14d62c6 commit dd39ecf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/librustc_mir/transform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ fn run_suite<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,

pass.run_pass(tcx, source, mir);

for (index, promoted_mir) in mir.promoted.iter_enumerated_mut() {
let promoted_source = MirSource::Promoted(source.item_id(), index);
pass.run_pass(tcx, promoted_source, promoted_mir);

// Let's make sure we don't miss any nested instances
assert!(promoted_mir.promoted.is_empty());
}

for hook in tcx.mir_passes.hooks() {
hook.on_mir_pass(tcx, suite, pass_num, &pass.name(), source, &mir, true);
}
Expand Down

0 comments on commit dd39ecf

Please sign in to comment.