Skip to content

Commit

Permalink
array pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Sep 20, 2020
1 parent 3435683 commit bfb221b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/rustc_mir_build/src/thir/pattern/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2300,18 +2300,18 @@ fn split_grouped_constructors<'p, 'tcx>(
split_ctors.extend(
borders
.array_windows()
.filter_map(|&[fst, snd]| match (fst, snd) {
(Border::JustBefore(n), Border::JustBefore(m)) => {
.filter_map(|&pair| match pair {
[Border::JustBefore(n), Border::JustBefore(m)] => {
if n < m {
Some(IntRange { range: n..=(m - 1), ty, span })
} else {
None
}
}
(Border::JustBefore(n), Border::AfterMax) => {
[Border::JustBefore(n), Border::AfterMax] => {
Some(IntRange { range: n..=u128::MAX, ty, span })
}
(Border::AfterMax, _) => None,
[Border::AfterMax, _] => None,
})
.map(IntRange),
);
Expand Down

0 comments on commit bfb221b

Please sign in to comment.