large_enums mir pass: fix is_enabled logic

This commit is contained in:
Ralf Jung
2026-03-25 16:33:59 +01:00
parent 8a703520e8
commit 298c251f91
@@ -32,8 +32,8 @@ impl<'tcx> crate::MirPass<'tcx> for EnumSizeOpt {
fn is_enabled(&self, sess: &Session) -> bool {
// There are some differences in behavior on wasm and ARM that are not properly
// understood, so we conservatively treat this optimization as unsound:
// https://github.com/rust-lang/rust/pull/85158#issuecomment-1101836457
sess.opts.unstable_opts.unsound_mir_opts || sess.mir_opt_level() >= 3
// https://github.com/rust-lang/rust/issues/154413
sess.opts.unstable_opts.unsound_mir_opts && sess.mir_opt_level() >= 3
}
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {