This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +5
-1
lines changed
compiler/rustc_mir_transform/src Expand file tree Collapse file tree 3 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ pub struct EarlyOtherwiseBranch;
9595
9696impl < ' tcx > MirPass < ' tcx > for EarlyOtherwiseBranch {
9797 fn is_enabled ( & self , sess : & rustc_session:: Session ) -> bool {
98+ // unsound: https://github.com/rust-lang/rust/issues/95162
9899 sess. mir_opt_level ( ) >= 3 && sess. opts . unstable_opts . unsound_mir_opts
99100 }
100101
Original file line number Diff line number Diff line change @@ -30,6 +30,9 @@ pub struct EnumSizeOpt {
3030
3131impl < ' tcx > MirPass < ' tcx > for EnumSizeOpt {
3232 fn is_enabled ( & self , sess : & Session ) -> bool {
33+ // There are some differences in behavior on wasm and ARM that are not properly
34+ // understood, so we conservatively treat this optimization as unsound:
35+ // https://github.com/rust-lang/rust/pull/85158#issuecomment-1101836457
3336 sess. opts . unstable_opts . unsound_mir_opts || sess. mir_opt_level ( ) >= 3
3437 }
3538 fn run_pass ( & self , tcx : TyCtxt < ' tcx > , body : & mut Body < ' tcx > ) {
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ pub struct RenameReturnPlace;
3434
3535impl < ' tcx > MirPass < ' tcx > for RenameReturnPlace {
3636 fn is_enabled ( & self , sess : & rustc_session:: Session ) -> bool {
37- // #111005
37+ // unsound: #111005
3838 sess. mir_opt_level ( ) > 0 && sess. opts . unstable_opts . unsound_mir_opts
3939 }
4040
You can’t perform that action at this time.
0 commit comments