1
Fork 0

use array_windows instead of windows in the compiler

This commit is contained in:
Bastian Kauschke 2020-09-17 09:28:14 +02:00
parent 255a4c58f5
commit 3435683fd5
11 changed files with 21 additions and 17 deletions

View file

@ -1,7 +1,7 @@
//! Construction of MIR from HIR.
//!
//! This crate also contains the match exhaustiveness and usefulness checking.
#![feature(array_windows)]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(const_fn)]

View file

@ -2299,8 +2299,8 @@ fn split_grouped_constructors<'p, 'tcx>(
// interval into a constructor.
split_ctors.extend(
borders
.windows(2)
.filter_map(|window| match (window[0], window[1]) {
.array_windows()
.filter_map(|&[fst, snd]| match (fst, snd) {
(Border::JustBefore(n), Border::JustBefore(m)) => {
if n < m {
Some(IntRange { range: n..=(m - 1), ty, span })