Skip to content

Commit dd9b476

Browse files
committed
Disable SimplifyBranchSame optimization for now
1 parent 20489ea commit dd9b476

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/rustc_mir_transform/src/simplify_try.rs

+6
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,12 @@ pub struct SimplifyBranchSame;
544544

545545
impl<'tcx> MirPass<'tcx> for SimplifyBranchSame {
546546
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
547+
// This optimization is disabled by default for now due to
548+
// soundness concerns; see issue #89485 and PR #89489.
549+
if !tcx.sess.opts.debugging_opts.unsound_mir_opts {
550+
return;
551+
}
552+
547553
trace!("Running SimplifyBranchSame on {:?}", body.source);
548554
let finder = SimplifyBranchSameOptimizationFinder { body, tcx };
549555
let opts = finder.find();

0 commit comments

Comments
 (0)