1
Fork 0

Disable SimplifyToExp in MatchBranchSimplification

This commit is contained in:
DianQK 2024-04-19 20:54:25 +08:00
parent 0ed85d0c8d
commit b52be28fda
No known key found for this signature in database
9 changed files with 160 additions and 202 deletions

View file

@ -41,7 +41,10 @@ impl<'tcx> MirPass<'tcx> for MatchBranchSimplification {
should_cleanup = true;
continue;
}
if SimplifyToExp::default().simplify(tcx, body, bb_idx, param_env).is_some() {
// unsound: https://github.com/rust-lang/rust/issues/124150
if tcx.sess.opts.unstable_opts.unsound_mir_opts
&& SimplifyToExp::default().simplify(tcx, body, bb_idx, param_env).is_some()
{
should_cleanup = true;
continue;
}