Skip to content

Commit

Permalink
test: update the unused_must_use error pattern
Browse files Browse the repository at this point in the history
After rust-lang/rust#42756, the error message no longer contains the
string "unused result", but "must be used" works before and after.
  • Loading branch information
cuviper committed Jun 23, 2017
1 parent 2114008 commit b9fa1a2
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions tests/compile-fail/must_use.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ use rayon::prelude::*;
fn main() {
let v: Vec<_> = (0..100).map(Some).collect();

v.par_iter().chain(&v); //~ ERROR unused result
v.par_iter().cloned(); //~ ERROR unused result
v.par_iter().enumerate(); //~ ERROR unused result
v.par_iter().filter(|_| true); //~ ERROR unused result
v.par_iter().filter_map(|x| *x); //~ ERROR unused result
v.par_iter().flat_map(|x| *x); //~ ERROR unused result
v.par_iter().fold(|| 0, |x, _| x); //~ ERROR unused result
v.par_iter().fold_with(0, |x, _| x); //~ ERROR unused result
v.par_iter().inspect(|_| {}); //~ ERROR unused result
v.par_iter().map(|x| x); //~ ERROR unused result
v.par_iter().map_with(0, |_, x| x); //~ ERROR unused result
v.par_iter().rev(); //~ ERROR unused result
v.par_iter().skip(1); //~ ERROR unused result
v.par_iter().take(1); //~ ERROR unused result
v.par_iter().cloned().while_some(); //~ ERROR unused result
v.par_iter().with_max_len(1); //~ ERROR unused result
v.par_iter().with_min_len(1); //~ ERROR unused result
v.par_iter().zip(&v); //~ ERROR unused result
v.par_iter().chain(&v); //~ ERROR must be used
v.par_iter().cloned(); //~ ERROR must be used
v.par_iter().enumerate(); //~ ERROR must be used
v.par_iter().filter(|_| true); //~ ERROR must be used
v.par_iter().filter_map(|x| *x); //~ ERROR must be used
v.par_iter().flat_map(|x| *x); //~ ERROR must be used
v.par_iter().fold(|| 0, |x, _| x); //~ ERROR must be used
v.par_iter().fold_with(0, |x, _| x); //~ ERROR must be used
v.par_iter().inspect(|_| {}); //~ ERROR must be used
v.par_iter().map(|x| x); //~ ERROR must be used
v.par_iter().map_with(0, |_, x| x); //~ ERROR must be used
v.par_iter().rev(); //~ ERROR must be used
v.par_iter().skip(1); //~ ERROR must be used
v.par_iter().take(1); //~ ERROR must be used
v.par_iter().cloned().while_some(); //~ ERROR must be used
v.par_iter().with_max_len(1); //~ ERROR must be used
v.par_iter().with_min_len(1); //~ ERROR must be used
v.par_iter().zip(&v); //~ ERROR must be used
}

0 comments on commit b9fa1a2

Please sign in to comment.