Exhaustively match on StatementKind during const checking
This commit is contained in:
parent
65a985e81e
commit
e590002652
1 changed files with 8 additions and 3 deletions
|
|
@ -478,15 +478,20 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
|
|||
StatementKind::Assign(..) | StatementKind::SetDiscriminant { .. } => {
|
||||
self.super_statement(statement, location);
|
||||
}
|
||||
StatementKind::FakeRead(FakeReadCause::ForMatchedPlace, _) => {
|
||||
|
||||
StatementKind::FakeRead(
|
||||
FakeReadCause::ForMatchedPlace
|
||||
| FakeReadCause::ForMatchGuard
|
||||
| FakeReadCause::ForGuardBinding,
|
||||
_,
|
||||
) => {
|
||||
self.check_op(ops::IfOrMatch);
|
||||
}
|
||||
StatementKind::LlvmInlineAsm { .. } => {
|
||||
self.check_op(ops::InlineAsm);
|
||||
}
|
||||
|
||||
// FIXME(eddyb) should these really do nothing?
|
||||
StatementKind::FakeRead(..)
|
||||
StatementKind::FakeRead(FakeReadCause::ForLet | FakeReadCause::ForIndex, _)
|
||||
| StatementKind::StorageLive(_)
|
||||
| StatementKind::StorageDead(_)
|
||||
| StatementKind::Retag { .. }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue