Add or-patterns to pattern types
This commit is contained in:
@@ -1248,6 +1248,14 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValueVisitor<'tcx, M> for ValidityVisitor<'rt,
|
||||
// Range patterns are precisely reflected into `valid_range` and thus
|
||||
// handled fully by `visit_scalar` (called below).
|
||||
ty::PatternKind::Range { .. } => {},
|
||||
|
||||
// FIXME(pattern_types): check that the value is covered by one of the variants.
|
||||
// For now, we rely on layout computation setting the scalar's `valid_range` to
|
||||
// match the pattern. However, this cannot always work; the layout may
|
||||
// pessimistically cover actually illegal ranges and Miri would miss that UB.
|
||||
// The consolation here is that codegen also will miss that UB, so at least
|
||||
// we won't see optimizations actually breaking such programs.
|
||||
ty::PatternKind::Or(_patterns) => {}
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
|
||||
Reference in New Issue
Block a user