提交 7f720304 编写于 作者: V varkor

Fix range splitting

上级 a20cb108
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册