Skip to content

Commit

Permalink
Unrolled build for rust-lang#120280
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#120280 - tmiasko:is-enabled, r=compiler-errors

Move condition enabling the pass to `is_enabled`

The practical motivation is to omit the pass from -Zdump-mir=all when disabled.
  • Loading branch information
rust-timer committed Jan 23, 2024
2 parents dfe53af + c8e4aaa commit 92e5ec7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions compiler/rustc_mir_transform/src/remove_storage_markers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ pub struct RemoveStorageMarkers;

impl<'tcx> MirPass<'tcx> for RemoveStorageMarkers {
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
sess.mir_opt_level() > 0
sess.mir_opt_level() > 0 && !sess.emit_lifetime_markers()
}

fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
if tcx.sess.emit_lifetime_markers() {
return;
}

fn run_pass(&self, _tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
trace!("Running RemoveStorageMarkers on {:?}", body.source);
for data in body.basic_blocks.as_mut_preserves_cfg() {
data.statements.retain(|statement| match statement.kind {
Expand Down

0 comments on commit 92e5ec7

Please sign in to comment.