1 #![feature(tool_lints)]
3 #![allow(unknown_lints, unused, clippy::no_effect, clippy::redundant_closure_call, clippy::many_single_char_names, clippy::needless_pass_by_value, clippy::option_map_unit_fn, clippy::trivially_copy_pass_by_ref)]
4 #![warn(clippy::redundant_closure, clippy::needless_borrow)]
7 let a = Some(1u8).map(|a| foo(a));
9 let c = Some(1u8).map(|a| {1+2; foo}(a));
10 let d = Some(1u8).map(|a| foo((|b| foo2(b))(a))); //is adjusted?
11 all(&[1, 2, 3], &&2, |x, y| below(x, y)); //is adjusted
13 Some(1u8).map(|a| unsafe_fn(a)); // unsafe fn
17 let e = Some(1u8).map(|a| divergent(a));
18 let e = Some(1u8).map(|a| generic(a));
19 let e = Some(1u8).map(generic);
21 let a: Option<Box<::std::ops::Deref<Target = [i32]>>> =
22 Some(vec![1i32, 2]).map(|v| -> Box<::std::ops::Deref<Target = [i32]>> { Box::new(v) });
25 fn meta<F>(f: F) where F: Fn(u8) {
32 fn foo2(_: u8) -> u8 {
36 fn all<X, F>(x: &[X], y: &X, f: F) -> bool
37 where F: Fn(&X, &X) -> bool {
38 x.iter().all(|e| f(e, y))
41 fn below(x: &u8, y: &u8) -> bool { x < y }
43 unsafe fn unsafe_fn(_: u8) { }
45 fn divergent(_: u8) -> ! {
49 fn generic<T>(_: T) -> u8 {