Remove bounds check with enum cast

This commit is contained in:
ouz-a 2022-10-26 17:50:11 +03:00
parent 4596f4f8b5
commit a1672ad5b8
9 changed files with 120 additions and 19 deletions

View file

@ -101,12 +101,10 @@ impl<'tcx> Visitor<'tcx> for UnsafetyChecker<'_, 'tcx> {
| StatementKind::Retag { .. }
| StatementKind::AscribeUserType(..)
| StatementKind::Coverage(..)
| StatementKind::Intrinsic(..)
| StatementKind::Nop => {
// safe (at least as emitted during MIR construction)
}
// Move to above list once mir construction uses it.
StatementKind::Intrinsic(..) => unreachable!(),
}
self.super_statement(statement, location);
}