Skip to content

Commit d24e39b

Browse files
Exhaustively match on TerminatorKind during const checking
1 parent e590002 commit d24e39b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/librustc_mir/transform/check_consts/validation.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,17 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
580580
}
581581
}
582582

583-
_ => {}
583+
TerminatorKind::Abort
584+
| TerminatorKind::Assert { .. }
585+
| TerminatorKind::FalseEdges { .. }
586+
| TerminatorKind::FalseUnwind { .. }
587+
| TerminatorKind::GeneratorDrop
588+
| TerminatorKind::Goto { .. }
589+
| TerminatorKind::Resume
590+
| TerminatorKind::Return
591+
| TerminatorKind::SwitchInt { .. }
592+
| TerminatorKind::Unreachable
593+
| TerminatorKind::Yield { .. } => {}
584594
}
585595
}
586596
}

0 commit comments

Comments
 (0)