diff options
| author | Fabian Wolff <fabian.wolff@alumni.ethz.ch> | 2021-10-03 22:58:24 +0200 |
|---|---|---|
| committer | Fabian Wolff <fabian.wolff@alumni.ethz.ch> | 2021-10-03 22:58:24 +0200 |
| commit | dd9b4763a4805e508cafd9aa49eebda27e5298c0 (patch) | |
| tree | bf9d73ac4f6d6e4bd40cbc3e1f3e0c5353861d15 | |
| parent | 20489eaca2ad541a35059d38e2b064c46d3bcc9f (diff) | |
| download | rust-dd9b4763a4805e508cafd9aa49eebda27e5298c0.tar.gz rust-dd9b4763a4805e508cafd9aa49eebda27e5298c0.zip | |
Disable `SimplifyBranchSame` optimization for now
| -rw-r--r-- | compiler/rustc_mir_transform/src/simplify_try.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_mir_transform/src/simplify_try.rs b/compiler/rustc_mir_transform/src/simplify_try.rs index f8c616a19e9..e436d73226a 100644 --- a/compiler/rustc_mir_transform/src/simplify_try.rs +++ b/compiler/rustc_mir_transform/src/simplify_try.rs @@ -544,6 +544,12 @@ pub struct SimplifyBranchSame; impl<'tcx> MirPass<'tcx> for SimplifyBranchSame { fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { + // This optimization is disabled by default for now due to + // soundness concerns; see issue #89485 and PR #89489. + if !tcx.sess.opts.debugging_opts.unsound_mir_opts { + return; + } + trace!("Running SimplifyBranchSame on {:?}", body.source); let finder = SimplifyBranchSameOptimizationFinder { body, tcx }; let opts = finder.find(); |
