2015-05-10 00:09:04 -05:00
|
|
|
#![feature(plugin)]
|
|
|
|
#![plugin(clippy)]
|
|
|
|
#![allow(unknown_lints, unused)]
|
|
|
|
#![deny(redundant_closure)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let a = |a, b| foo(a, b);
|
2015-08-12 03:46:49 -05:00
|
|
|
//~^ ERROR redundant closure found. Consider using `foo` in its place
|
2015-05-10 00:09:04 -05:00
|
|
|
let c = |a, b| {1+2; foo}(a, b);
|
2015-08-12 03:46:49 -05:00
|
|
|
//~^ ERROR redundant closure found. Consider using `{ 1 + 2; foo }` in its place
|
2015-05-10 00:09:04 -05:00
|
|
|
let d = |a, b| foo((|c, d| foo2(c,d))(a,b), b);
|
2015-08-12 03:46:49 -05:00
|
|
|
//~^ ERROR redundant closure found. Consider using `foo2` in its place
|
2015-05-10 00:09:04 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn foo(_: u8, _: u8) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
fn foo2(_: u8, _: u8) -> u8 {
|
|
|
|
1u8
|
2015-08-12 03:46:49 -05:00
|
|
|
}
|