Skip to content

Commit 8a0c3fe

Browse files
committed
fix(mir): remove redundant check when lowering switch
1 parent 5850c64 commit 8a0c3fe

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/passes/mir_gen.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,7 @@ impl<'ctx, 'hir, 'thir> MirGen<'ctx, 'hir, 'thir> {
402402
let lowered_block = self.lower_block(ctx, *default);
403403

404404
// Store the resulting block value.
405-
if let Some(result) = lowered_block.operand
406-
&& !matches!(&self.ctx.types[switch_ty], Type::Never)
407-
{
405+
if let Some(result) = lowered_block.operand {
408406
self.mir.add_statement(
409407
lowered_block.exit,
410408
Assign {

0 commit comments

Comments
 (0)