Commit 3a2f267
committed
Auto merge of #148034 - dianqk:matchbr-copy, r=cjgillot
Simplify the canonical enum clone branches to a copy statement
I have overhauled MatchBranchSimplification in this PR. This pass tries to unify statements one by one, which is more readable and extensible.
This PR also unifies the following pattern that is mostly generated by GVN into one basic block that contains the copy statement:
```rust
match a {
Foo::A(_) => *a,
Foo::B => Foo::B
}
```
Fixes rust-lang/rust#128081.0 file changed
0 commit comments