Skip to content

Commit 3970b01

Browse files
committed
Re-enable the early otherwise branch optimization
1 parent cb008a0 commit 3970b01

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

compiler/rustc_mir_transform/src/early_otherwise_branch.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ pub struct EarlyOtherwiseBranch;
9696

9797
impl<'tcx> MirPass<'tcx> for EarlyOtherwiseBranch {
9898
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
99-
// unsound: https://github.com/rust-lang/rust/issues/95162
100-
sess.mir_opt_level() >= 3 && sess.opts.unstable_opts.unsound_mir_opts
99+
sess.mir_opt_level() >= 2
101100
}
102101

103102
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {

tests/codegen/enum/enum-early-otherwise-branch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags: -O -Zmir-opt-level=3 -Zunsound-mir-opts
1+
//@ compile-flags: -O
22

33
#![crate_type = "lib"]
44

0 commit comments

Comments
 (0)