Disable two mir opts that are known to be unsound

This commit is contained in:
Oli Scherer 2023-06-20 10:04:34 +00:00
parent c55d1ee8d4
commit c409f05636
9 changed files with 177 additions and 184 deletions

View file

@ -46,7 +46,9 @@ pub struct SeparateConstSwitch;
impl<'tcx> MirPass<'tcx> for SeparateConstSwitch {
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
sess.mir_opt_level() >= 2
// This pass participates in some as-of-yet untested unsoundness found
// in https://github.com/rust-lang/rust/issues/112460
sess.mir_opt_level() >= 2 && sess.opts.unstable_opts.unsound_mir_opts
}
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {