Skip to content

Commit 87c7a23

Browse files
committed
Revert "Remove restrictions on small enum statements such as Order, Option or Result"
This reverts commit 102bda4.
1 parent 52618eb commit 87c7a23

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

compiler/rustc_mir_transform/src/unreachable_enum_branching.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,7 @@ impl<'tcx> crate::MirPass<'tcx> for UnreachableEnumBranching {
179179
// ```
180180
let otherwise_is_last_variant = !otherwise_is_empty_unreachable
181181
&& allowed_variants.len() == 1
182-
// Despite the LLVM issue, we hope that small enum can still be transformed.
183-
// This is valuable for both `a <= b` and `if let Some/Ok(v)`.
184-
&& (targets.all_targets().len() <= 3
185-
|| check_successors(&body.basic_blocks, targets.otherwise()));
182+
&& check_successors(&body.basic_blocks, targets.otherwise());
186183
let replace_otherwise_to_unreachable = otherwise_is_last_variant
187184
|| (!otherwise_is_empty_unreachable && allowed_variants.is_empty());
188185

0 commit comments

Comments
 (0)