Skip to content

Commit 41198cb

Browse files
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 #128081.
2 parents fbd6934 + b4e3de0 commit 41198cb

19 files changed

+1053
-490
lines changed

compiler/rustc_mir_transform/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#![feature(cow_is_borrowed)]
77
#![feature(file_buffered)]
88
#![feature(impl_trait_in_assoc_type)]
9+
#![feature(iterator_try_collect)]
910
#![feature(try_blocks)]
1011
#![feature(yeet_expr)]
1112
// tidy-alphabetical-end

0 commit comments

Comments
 (0)