Fix range splitting
This commit is contained in:
parent
a20cb1084a
commit
7f72030421
2 changed files with 6 additions and 6 deletions
|
@ -725,8 +725,8 @@ fn ranges_subtract_pattern<'a, 'tcx>(cx: &mut MatchCheckCtxt<'a, 'tcx>,
|
|||
} else {
|
||||
// The pattern intersects the middle of the subrange,
|
||||
// so we create two ranges either side of the intersection.)
|
||||
remaining_ranges.push((subrange_lo, pat_interval.lo));
|
||||
remaining_ranges.push((pat_interval.hi, subrange_hi));
|
||||
remaining_ranges.push((subrange_lo, pat_interval.lo - 1));
|
||||
remaining_ranges.push((pat_interval.hi + 1, subrange_hi));
|
||||
}
|
||||
}
|
||||
// Convert the remaining ranges from pairs to inclusive `ConstantRange`s.
|
||||
|
|
|
@ -16,11 +16,11 @@ error[E0004]: non-exhaustive patterns: `128u8...255u8` not covered
|
|||
LL | match x { //~ ERROR non-exhaustive patterns: `128u8...255u8` not covered
|
||||
| ^ pattern `128u8...255u8` not covered
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `11u8...20u8`, `30u8...35u8`, `35u8...70u8` and 1 more not covered
|
||||
error[E0004]: non-exhaustive patterns: `11u8...19u8`, `31u8...34u8`, `36u8...69u8` and 1 more not covered
|
||||
--> $DIR/exhaustive_integer_patterns.rs:42:11
|
||||
|
|
||||
LL | match x { //~ ERROR non-exhaustive patterns
|
||||
| ^ patterns `11u8...20u8`, `30u8...35u8`, `35u8...70u8` and 1 more not covered
|
||||
| ^ patterns `11u8...19u8`, `31u8...34u8`, `36u8...69u8` and 1 more not covered
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/exhaustive_integer_patterns.rs:53:9
|
||||
|
@ -28,11 +28,11 @@ error: unreachable pattern
|
|||
LL | -2..=20 => {} //~ ERROR unreachable pattern
|
||||
| ^^^^^^^
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `-128i8...-5i8`, `120i8...121i8` and `121i8...127i8` not covered
|
||||
error[E0004]: non-exhaustive patterns: `-128i8...-6i8` and `122i8...127i8` not covered
|
||||
--> $DIR/exhaustive_integer_patterns.rs:50:11
|
||||
|
|
||||
LL | match x { //~ ERROR non-exhaustive patterns
|
||||
| ^ patterns `-128i8...-5i8`, `120i8...121i8` and `121i8...127i8` not covered
|
||||
| ^ patterns `-128i8...-6i8` and `122i8...127i8` not covered
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue