summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/struct_excessive_bools.rs
blob: ce4fe830a0a210e17e692b00fa01baf6f4c444fe (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
33
34
35
36
37
38
39
40
41
42
43
44
#![warn(clippy::struct_excessive_bools)]

macro_rules! foo {
    () => {
        struct MacroFoo {
            a: bool,
            b: bool,
            c: bool,
            d: bool,
        }
    };
}

foo!();

struct Foo {
    a: bool,
    b: bool,
    c: bool,
}

struct BadFoo {
    a: bool,
    b: bool,
    c: bool,
    d: bool,
}

#[repr(C)]
struct Bar {
    a: bool,
    b: bool,
    c: bool,
    d: bool,
}

fn main() {
    struct FooFoo {
        a: bool,
        b: bool,
        c: bool,
        d: bool,
    }
}