aboutsummaryrefslogtreecommitdiff
path: root/src/compile_fail/cannot_zip_filtered_data.rs
blob: de43fca57f7ddb9ced5c8df0e758cd5f6b1a7496 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
}

``` */