2 #![warn(clippy::precedence)]
3 #![allow(unused_must_use, clippy::no_effect, clippy::unnecessary_operation)]
4 #![allow(clippy::identity_op)]
5 #![allow(clippy::eq_op)]
9 match $a & 0b1111_1111u8 {
10 0 => println!("a is zero ({})", $a),
11 _ => println!("a is {}", $a),
27 // These should not trigger an error
28 let _ = (-1i32).abs();
29 let _ = (-1f32).abs();
30 let _ = -(1i32).abs();
31 let _ = -(1f32).abs();
32 let _ = -(1i32.abs());
33 let _ = -(1f32.abs());
35 // Odd functions should not trigger an error
37 let _ = -1f64.asinh();
39 let _ = -1f64.atanh();
41 let _ = -1f64.fract();
42 let _ = -1f64.round();
43 let _ = -1f64.signum();
48 let _ = -1f64.to_degrees();
49 let _ = -1f64.to_radians();
51 // Chains containing any non-odd function should trigger (issue #5924)
52 let _ = -1.0_f64.cos().cos();
53 let _ = -1.0_f64.cos().sin();
54 let _ = -1.0_f64.sin().cos();
56 // Chains of odd functions shouldn't trigger
57 let _ = -1f64.sin().sin();