Change way of checking SetDiscriminant

This commit is contained in:
Christian Poveda 2019-11-26 17:23:24 -05:00
parent c66ad14057
commit d7c09f7e1e

View file

@ -566,9 +566,8 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
StatementKind::FakeRead(FakeReadCause::ForMatchedPlace, _) => {
self.check_op(ops::IfOrMatch);
}
StatementKind::SetDiscriminant { ref place, .. } => {
let ctx = PlaceContext::MutatingUse(MutatingUseContext::Projection);
self.visit_place(&place, ctx, location)
StatementKind::SetDiscriminant { .. } => {
self.super_statement(statement, location)
}
// FIXME(eddyb) should these really do nothing?
StatementKind::FakeRead(..) |