]> git.proxmox.com Git - rustc.git/blobdiff - vendor/rustc-rayon/src/iter/mod.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / vendor / rustc-rayon / src / iter / mod.rs
index e10aaaf45212924c2400a3e5b894c8121c06b017..e07370957925cc8f009c6daf4dd68708ebb4cf97 100644 (file)
 //! to mirror the unstable `std::ops::Try` with implementations for `Option` and
 //! `Result`, where `Some`/`Ok` values will let those iterators continue, but
 //! `None`/`Err` values will exit early.
+//!
+//! A note about object safety: It is currently _not_ possible to wrap
+//! a `ParallelIterator` (or any trait that depends on it) using a
+//! `Box<dyn ParallelIterator>` or other kind of dynamic allocation,
+//! because `ParallelIterator` is **not object-safe**.
+//! (This keeps the implementation simpler and allows extra optimizations.)
 
 use self::plumbing::*;
 use self::private::Try;
@@ -135,6 +141,8 @@ mod zip;
 pub use self::zip::Zip;
 mod zip_eq;
 pub use self::zip_eq::ZipEq;
+mod multizip;
+pub use self::multizip::MultiZip;
 mod interleave;
 pub use self::interleave::Interleave;
 mod interleave_shortest;
@@ -395,9 +403,6 @@ pub trait ParallelIterator: Sized + Send {
     /// # Examples
     ///
     /// ```
-    /// extern crate rand;
-    /// extern crate rayon;
-    ///
     /// use rand::Rng;
     /// use rayon::prelude::*;
     ///
@@ -506,9 +511,6 @@ pub trait ParallelIterator: Sized + Send {
     /// # Examples
     ///
     /// ```
-    /// extern crate rand;
-    /// extern crate rayon;
-    ///
     /// use rand::Rng;
     /// use rayon::prelude::*;
     ///
@@ -628,9 +630,6 @@ pub trait ParallelIterator: Sized + Send {
     /// # Examples
     ///
     /// ```
-    /// extern crate rand;
-    /// extern crate rayon;
-    ///
     /// use rand::Rng;
     /// use rayon::prelude::*;
     ///