diff options
| author | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-09-17 09:28:14 +0200 |
|---|---|---|
| committer | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-09-20 08:11:05 +0200 |
| commit | 3435683fd5930676b5a7ccd40dc08e4758e8b90a (patch) | |
| tree | 74920e5620b83156a7e5d8b28e83e141432a98f2 /compiler/rustc_data_structures/src | |
| parent | 255a4c58f5863ed41c2e68792799125c6c676575 (diff) | |
| download | rust-3435683fd5930676b5a7ccd40dc08e4758e8b90a.tar.gz rust-3435683fd5930676b5a7ccd40dc08e4758e8b90a.zip | |
use `array_windows` instead of `windows` in the compiler
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/lib.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_data_structures/src/sorted_map.rs | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_data_structures/src/lib.rs b/compiler/rustc_data_structures/src/lib.rs index 06718cc9803..3322edd18cc 100644 --- a/compiler/rustc_data_structures/src/lib.rs +++ b/compiler/rustc_data_structures/src/lib.rs @@ -8,6 +8,7 @@ #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] #![allow(incomplete_features)] +#![feature(array_windows)] #![feature(control_flow_enum)] #![feature(in_band_lifetimes)] #![feature(unboxed_closures)] diff --git a/compiler/rustc_data_structures/src/sorted_map.rs b/compiler/rustc_data_structures/src/sorted_map.rs index 856eb73e629..4807380595d 100644 --- a/compiler/rustc_data_structures/src/sorted_map.rs +++ b/compiler/rustc_data_structures/src/sorted_map.rs @@ -34,7 +34,7 @@ impl<K: Ord, V> SortedMap<K, V> { /// and that there are no duplicates. #[inline] pub fn from_presorted_elements(elements: Vec<(K, V)>) -> SortedMap<K, V> { - debug_assert!(elements.windows(2).all(|w| w[0].0 < w[1].0)); + debug_assert!(elements.array_windows().all(|[fst, snd]| fst.0 < snd.0)); SortedMap { data: elements } } @@ -159,7 +159,7 @@ impl<K: Ord, V> SortedMap<K, V> { return; } - debug_assert!(elements.windows(2).all(|w| w[0].0 < w[1].0)); + debug_assert!(elements.array_windows().all(|[fst, snd]| fst.0 < snd.0)); let start_index = self.lookup_index_for(&elements[0].0); |
