blob: ab9bdde6cf902b7e4bddb6c1a2e1f48e03e3594a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#![warn(clippy::suspicious_unary_op_formatting)]
#![allow(clippy::needless_if)]
#[rustfmt::skip]
fn main() {
// weird binary operator formatting:
let a = 42;
if a >- 30 {}
//~^ suspicious_unary_op_formatting
if a >=- 30 {}
//~^ suspicious_unary_op_formatting
let b = true;
let c = false;
if b &&! c {}
//~^ suspicious_unary_op_formatting
if a >- 30 {}
//~^ suspicious_unary_op_formatting
// those are ok:
if a >-30 {}
if a < -30 {}
if b && !c {}
if a > - 30 {}
}
|