summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/suspicious_unary_op_formatting.rs
blob: 9564e373c246d7094c89821734c285de7c867d18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#![warn(clippy::suspicious_unary_op_formatting)]

#[rustfmt::skip]
fn main() {
    // weird binary operator formatting:
    let a = 42;

    if a >- 30 {}
    if a >=- 30 {}

    let b = true;
    let c = false;

    if b &&! c {}

    if a >-   30 {}

    // those are ok:
    if a >-30 {}
    if a < -30 {}
    if b && !c {}
    if a > -   30 {}
}