rust-clippy/tests/ui/struct_excessive_bools.rs

47 lines
621 B
Rust
Raw Normal View History

2020-02-01 23:49:52 +00: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 {
//~^ ERROR: more than 3 bools in a struct
2020-02-01 23:49:52 +00: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 {
//~^ ERROR: more than 3 bools in a struct
2020-02-01 23:49:52 +00:00
a: bool,
b: bool,
c: bool,
d: bool,
}
}