add tests
This commit is contained in:
parent
77e2155778
commit
eef439cb78
1 changed files with 15 additions and 0 deletions
15
tests/compile-fail/filter_methods.rs
Normal file
15
tests/compile-fail/filter_methods.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
#![feature(plugin)]
|
||||
#![plugin(clippy)]
|
||||
|
||||
#![deny(clippy, clippy_pedantic)]
|
||||
fn main() {
|
||||
let _: Vec<_> = vec![5; 6].into_iter() //~ERROR called `filter(p).map(q)` on an Iterator
|
||||
.filter(|&x| x == 0)
|
||||
.map(|x| x * 2)
|
||||
.collect();
|
||||
|
||||
let _: Vec<_> = vec![5i8; 6].into_iter() //~ERROR called `filter(p).flat_map(q)` on an Iterator
|
||||
.filter(|&x| x == 0)
|
||||
.flat_map(|x| x.checked_mul(2))
|
||||
.collect();
|
||||
}
|
Loading…
Reference in a new issue