Skip to content

Commit

Permalink
Re-enable SimplifyToExp in match_branches.
Browse files Browse the repository at this point in the history
  • Loading branch information
DianQK committed Jul 31, 2024
1 parent cd03f2b commit 715558d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
5 changes: 1 addition & 4 deletions compiler/rustc_mir_transform/src/match_branches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 0 additions & 1 deletion tests/mir-opt/matches_reduce_branches.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ test-mir-pass: MatchBranchSimplification
//@ compile-flags: -Zunsound-mir-opts

#![feature(repr128)]
#![feature(core_intrinsics)]
Expand Down
1 change: 0 additions & 1 deletion tests/mir-opt/matches_u8.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 715558d

Please sign in to comment.