Skip to content

Commit f58bd5c

Browse files
committed
Auto merge of #154375 - RalfJung:large_enums, r=wesleywiser
large_enums mir pass: fix is_enabled logic This logic got turned from a guard in `run_pass` to an `is_enabled` check in 15d4728#r2989096960, but that was done incorrectly. The pass must never be enabled without `unsound_mir_opts`!
2 parents 3a933e5 + 298c251 commit f58bd5c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

compiler/rustc_mir_transform/src/large_enums.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ impl<'tcx> crate::MirPass<'tcx> for EnumSizeOpt {
3232
fn is_enabled(&self, sess: &Session) -> bool {
3333
// There are some differences in behavior on wasm and ARM that are not properly
3434
// understood, so we conservatively treat this optimization as unsound:
35-
// https://github.com/rust-lang/rust/pull/85158#issuecomment-1101836457
36-
sess.opts.unstable_opts.unsound_mir_opts || sess.mir_opt_level() >= 3
35+
// https://github.com/rust-lang/rust/issues/154413
36+
sess.opts.unstable_opts.unsound_mir_opts && sess.mir_opt_level() >= 3
3737
}
3838

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

0 commit comments

Comments
 (0)