diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2024-01-23 21:19:56 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-23 21:19:56 +0100 |
| commit | 08bac31f8f95a9cf2bdcbecfb65ca8de5b644699 (patch) | |
| tree | c1fb20b5e72855a5a638b349d6c69ba76ae1a0fd | |
| parent | 3b1c2eb44ce3f44bbf75aecf00244a946bc50abd (diff) | |
| parent | c8e4aaa023334ea9844eb76eebe41da138895a81 (diff) | |
| download | rust-08bac31f8f95a9cf2bdcbecfb65ca8de5b644699.tar.gz rust-08bac31f8f95a9cf2bdcbecfb65ca8de5b644699.zip | |
Rollup merge of #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.
| -rw-r--r-- | compiler/rustc_mir_transform/src/remove_storage_markers.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/compiler/rustc_mir_transform/src/remove_storage_markers.rs b/compiler/rustc_mir_transform/src/remove_storage_markers.rs index 795f5232ee3..f68e592db15 100644 --- a/compiler/rustc_mir_transform/src/remove_storage_markers.rs +++ b/compiler/rustc_mir_transform/src/remove_storage_markers.rs @@ -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 { |
