summaryrefslogtreecommitdiffstats
path: root/vendor/rustc-rayon/src/array.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/rustc-rayon/src/array.rs')
-rw-r--r--vendor/rustc-rayon/src/array.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/vendor/rustc-rayon/src/array.rs b/vendor/rustc-rayon/src/array.rs
index c9bd8bd05..32a5fdd2f 100644
--- a/vendor/rustc-rayon/src/array.rs
+++ b/vendor/rustc-rayon/src/array.rs
@@ -1,11 +1,8 @@
-#![cfg(has_min_const_generics)]
//! Parallel iterator types for [arrays] (`[T; N]`)
//!
//! You will rarely need to interact with this module directly unless you need
//! to name one of the iterator types.
//!
-//! Everything in this module requires const generics, stabilized in Rust 1.51.
-//!
//! [arrays]: https://doc.rust-lang.org/std/primitive.array.html
use crate::iter::plumbing::*;
@@ -14,7 +11,6 @@ use crate::slice::{Iter, IterMut};
use crate::vec::DrainProducer;
use std::mem::ManuallyDrop;
-/// This implementation requires const generics, stabilized in Rust 1.51.
impl<'data, T: Sync + 'data, const N: usize> IntoParallelIterator for &'data [T; N] {
type Item = &'data T;
type Iter = Iter<'data, T>;
@@ -24,7 +20,6 @@ impl<'data, T: Sync + 'data, const N: usize> IntoParallelIterator for &'data [T;
}
}
-/// This implementation requires const generics, stabilized in Rust 1.51.
impl<'data, T: Send + 'data, const N: usize> IntoParallelIterator for &'data mut [T; N] {
type Item = &'data mut T;
type Iter = IterMut<'data, T>;
@@ -34,7 +29,6 @@ impl<'data, T: Send + 'data, const N: usize> IntoParallelIterator for &'data mut
}
}
-/// This implementation requires const generics, stabilized in Rust 1.51.
impl<T: Send, const N: usize> IntoParallelIterator for [T; N] {
type Item = T;
type Iter = IntoIter<T, N>;
@@ -84,7 +78,8 @@ impl<T: Send, const N: usize> IndexedParallelIterator for IntoIter<T, N> {
unsafe {
// Drain every item, and then the local array can just fall out of scope.
let mut array = ManuallyDrop::new(self.array);
- callback.callback(DrainProducer::new(&mut *array))
+ let producer = DrainProducer::new(array.as_mut_slice());
+ callback.callback(producer)
}
}
}