Skip to content

Commit

Permalink
Auto merge of #130775 - jieyouxu:revert-129047, r=nagisa
Browse files Browse the repository at this point in the history
Revert "Apply EarlyOtherwiseBranch to scalar value #129047"

This reverts PR #129047, commit a772336fb3fbd1fe4493077fcfe04e0221296a99, reversing changes made to 702987f75b74f789ba227ee04a3d7bb1680c2309.

cc `@DianQK` and `@cjgillot` as the PR author and reviewer of #129047 respectively.

It seems [Apply EarlyOtherwiseBranch to scalar value #129047](rust-lang/rust#129047) may have lead to several nightly regressions:

- rust-lang/rust#130769
- rust-lang/rust#130774
- rust-lang/rust#130771

Example test that would ICE with changes in #129047 (this test is included in this PR):

```rs
//@ compile-flags: -C opt-level=3
//@ check-pass

use std::task::Poll;

pub fn poll(val: Poll<Result<Option<Vec<u8>>, u8>>) {
    match val {
        Poll::Ready(Ok(Some(_trailers))) => {}
        Poll::Ready(Err(_err)) => {}
        Poll::Ready(Ok(None)) => {}
        Poll::Pending => {}
    }
}
```

Since this is a mir-opt ICE that seems to quite easy to trigger with real-world crates being affected, let's revert for now and reland the mir-opt after these are fixed.
  • Loading branch information
bors committed Sep 24, 2024
2 parents 75904ca + 4c3026d commit 789bfcc
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 789bfcc

Please sign in to comment.