also const-check FakeRead

This commit is contained in:
Ralf Jung 2020-12-19 20:25:27 +01:00
parent bd2f1cb278
commit f4085f0d3a
4 changed files with 40 additions and 7 deletions

View file

@ -722,17 +722,16 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
fn visit_statement(&mut self, statement: &Statement<'tcx>, location: Location) {
trace!("visit_statement: statement={:?} location={:?}", statement, location);
match statement.kind {
StatementKind::Assign(..) | StatementKind::SetDiscriminant { .. } => {
self.super_statement(statement, location);
}
self.super_statement(statement, location);
match statement.kind {
StatementKind::LlvmInlineAsm { .. } => {
self.super_statement(statement, location);
self.check_op(ops::InlineAsm);
}
StatementKind::FakeRead(..)
StatementKind::Assign(..)
| StatementKind::SetDiscriminant { .. }
| StatementKind::FakeRead(..)
| StatementKind::StorageLive(_)
| StatementKind::StorageDead(_)
| StatementKind::Retag { .. }