Mark early otherwise optimization unsound

This commit is contained in:
Santiago Pastorino
2021-03-18 17:35:46 -03:00
parent 1705a7d64b
commit 778e1978d5
3 changed files with 7 additions and 2 deletions

View File

@@ -26,6 +26,11 @@ pub struct EarlyOtherwiseBranch;
impl<'tcx> MirPass<'tcx> for EarlyOtherwiseBranch {
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
// FIXME(#78496)
if !tcx.sess.opts.debugging_opts.unsound_mir_opts {
return;
}
if tcx.sess.mir_opt_level() < 3 {
return;
}