blob: f0593556e5e0d5f5ca5323ee32cf5c85a623331f [file] [log] [blame]
extern crate rayon;
// Check that `!Send` types fail early.
use rayon::prelude::*;
use std::ptr::null;
#[derive(Copy, Clone)]
struct NoSend(*const ());
unsafe impl Sync for NoSend {}
fn main() {
let x = Some(NoSend(null()));
x.par_iter()
.map(|&x| x) //~ ERROR E0277
.count(); //~ ERROR E0599
x.par_iter()
.filter_map(|&x| Some(x)) //~ ERROR E0277
.count(); //~ ERROR E0599
x.par_iter()
.cloned() //~ ERROR E0277
.count(); //~ ERROR E0599
}