2022-03-28 11:35:43 +02:00
|
|
|
#![warn(clippy::empty_structs_with_brackets)]
|
2022-03-27 14:16:08 +02:00
|
|
|
#![allow(dead_code)]
|
|
|
|
|
2022-03-27 14:41:09 +02:00
|
|
|
pub struct MyEmptyStruct; // should trigger lint
|
|
|
|
struct MyEmptyTupleStruct; // should trigger lint
|
2022-03-27 14:16:08 +02:00
|
|
|
|
2022-03-27 19:58:23 +02:00
|
|
|
// should not trigger lint
|
|
|
|
struct MyCfgStruct {
|
|
|
|
#[cfg(feature = "thisisneverenabled")]
|
|
|
|
field: u8,
|
|
|
|
}
|
|
|
|
|
|
|
|
// should not trigger lint
|
|
|
|
struct MyCfgTupleStruct(#[cfg(feature = "thisisneverenabled")] u8);
|
|
|
|
|
|
|
|
// should not trigger lint
|
2022-03-27 14:41:09 +02:00
|
|
|
struct MyStruct {
|
2022-03-27 14:16:08 +02:00
|
|
|
field: u8,
|
|
|
|
}
|
2022-03-27 14:41:09 +02:00
|
|
|
struct MyTupleStruct(usize, String); // should not trigger lint
|
2022-03-28 11:18:20 +02:00
|
|
|
struct MySingleTupleStruct(usize); // should not trigger lint
|
|
|
|
struct MyUnitLikeStruct; // should not trigger lint
|
2022-03-27 14:16:08 +02:00
|
|
|
|
|
|
|
fn main() {}
|