2020-02-01 17:49:52 -06:00
|
|
|
#![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 {
|
2023-08-24 14:32:12 -05:00
|
|
|
//~^ ERROR: more than 3 bools in a struct
|
2020-02-01 17:49:52 -06:00
|
|
|
a: bool,
|
|
|
|
b: bool,
|
|
|
|
c: bool,
|
|
|
|
d: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[repr(C)]
|
|
|
|
struct Bar {
|
|
|
|
a: bool,
|
|
|
|
b: bool,
|
|
|
|
c: bool,
|
|
|
|
d: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
struct FooFoo {
|
2023-08-24 14:32:12 -05:00
|
|
|
//~^ ERROR: more than 3 bools in a struct
|
2020-02-01 17:49:52 -06:00
|
|
|
a: bool,
|
|
|
|
b: bool,
|
|
|
|
c: bool,
|
|
|
|
d: bool,
|
|
|
|
}
|
|
|
|
}
|