diff options
| author | DianQK <dianqk@dianqk.net> | 2024-07-31 07:58:39 +0800 |
|---|---|---|
| committer | DianQK <dianqk@dianqk.net> | 2024-08-03 10:55:46 +0800 |
| commit | 1f9d9603c05a1fb56825b4fc54ea28aa04485024 (patch) | |
| tree | 44ebd16240d3693f805102c33c54917536ca6a16 | |
| parent | 8b9d7b1489ddd90a69820b6b4f146a79351e850d (diff) | |
| download | rust-1f9d9603c05a1fb56825b4fc54ea28aa04485024.tar.gz rust-1f9d9603c05a1fb56825b4fc54ea28aa04485024.zip | |
Re-enable SimplifyToExp in match_branches.
| -rw-r--r-- | compiler/rustc_mir_transform/src/match_branches.rs | 5 | ||||
| -rw-r--r-- | tests/mir-opt/matches_reduce_branches.rs | 1 | ||||
| -rw-r--r-- | tests/mir-opt/matches_u8.rs | 1 |
3 files changed, 1 insertions, 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 @@ impl<'tcx> MirPass<'tcx> for MatchBranchSimplification { 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 |
