Skip to content

Commit c8e4aaa

Browse files
committed
Move condition enabling the pass to is_enabled
The practical motivation is to omit the pass from -Zdump-mir=all when disabled.
1 parent 6265a95 commit c8e4aaa

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

compiler/rustc_mir_transform/src/remove_storage_markers.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@ pub struct RemoveStorageMarkers;
77

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

13-
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
14-
if tcx.sess.emit_lifetime_markers() {
15-
return;
16-
}
17-
13+
fn run_pass(&self, _tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
1814
trace!("Running RemoveStorageMarkers on {:?}", body.source);
1915
for data in body.basic_blocks.as_mut_preserves_cfg() {
2016
data.statements.retain(|statement| match statement.kind {

0 commit comments

Comments
 (0)