diff options
Diffstat (limited to '')
-rw-r--r-- | vendor/rayon/src/compile_fail/cannot_zip_filtered_data.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vendor/rayon/src/compile_fail/cannot_zip_filtered_data.rs b/vendor/rayon/src/compile_fail/cannot_zip_filtered_data.rs new file mode 100644 index 000000000..de43fca57 --- /dev/null +++ b/vendor/rayon/src/compile_fail/cannot_zip_filtered_data.rs @@ -0,0 +1,16 @@ +/*! ```compile_fail,E0277 + +use rayon::prelude::*; + +// zip requires data of exact size, but filter yields only bounded +// size, so check that we cannot apply it. + +fn main() { + let mut a: Vec<usize> = (0..1024).rev().collect(); + let b: Vec<usize> = (0..1024).collect(); + + a.par_iter() + .zip(b.par_iter().filter(|&&x| x > 3)); //~ ERROR +} + +``` */ |