From 1f9d9603c05a1fb56825b4fc54ea28aa04485024 Mon Sep 17 00:00:00 2001 From: DianQK Date: Wed, 31 Jul 2024 07:58:39 +0800 Subject: [PATCH] Re-enable SimplifyToExp in match_branches. --- compiler/rustc_mir_transform/src/match_branches.rs | 5 +---- tests/mir-opt/matches_reduce_branches.rs | 1 - tests/mir-opt/matches_u8.rs | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/compiler/rustc_mir_transform/src/match_branches.rs b/compiler/rustc_mir_transform/src/match_branches.rs index 68000fe0ef8..47758b56f8c 100644 --- a/compiler/rustc_mir_transform/src/match_branches.rs +++ b/compiler/rustc_mir_transform/src/match_branches.rs @@ -44,10 +44,7 @@ fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { should_cleanup = true; continue; } - // unsound: https://github.com/rust-lang/rust/issues/124150 - if tcx.sess.opts.unstable_opts.unsound_mir_opts - && SimplifyToExp::default().simplify(tcx, body, bb_idx, param_env).is_some() - { + if SimplifyToExp::default().simplify(tcx, body, bb_idx, param_env).is_some() { should_cleanup = true; continue; } diff --git a/tests/mir-opt/matches_reduce_branches.rs b/tests/mir-opt/matches_reduce_branches.rs index 9328c616127..6787e5816a3 100644 --- a/tests/mir-opt/matches_reduce_branches.rs +++ b/tests/mir-opt/matches_reduce_branches.rs @@ -1,5 +1,4 @@ //@ test-mir-pass: MatchBranchSimplification -//@ compile-flags: -Zunsound-mir-opts #![feature(repr128)] #![feature(core_intrinsics)] diff --git a/tests/mir-opt/matches_u8.rs b/tests/mir-opt/matches_u8.rs index 89deead461e..86d64625674 100644 --- a/tests/mir-opt/matches_u8.rs +++ b/tests/mir-opt/matches_u8.rs @@ -1,6 +1,5 @@ // skip-filecheck //@ test-mir-pass: MatchBranchSimplification -//@ compile-flags: -Zunsound-mir-opts // EMIT_MIR matches_u8.exhaustive_match.MatchBranchSimplification.diff // EMIT_MIR matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff