2023-04-23 06:03:09 -05:00
|
|
|
//@run-rustfix
|
2022-04-07 12:39:59 -05:00
|
|
|
#![warn(clippy::empty_structs_with_brackets)]
|
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
pub struct MyEmptyStruct; // should trigger lint
|
|
|
|
struct MyEmptyTupleStruct; // should trigger lint
|
|
|
|
|
|
|
|
// 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
|
|
|
|
struct MyStruct {
|
|
|
|
field: u8,
|
|
|
|
}
|
|
|
|
struct MyTupleStruct(usize, String); // should not trigger lint
|
|
|
|
struct MySingleTupleStruct(usize); // should not trigger lint
|
|
|
|
struct MyUnitLikeStruct; // should not trigger lint
|
|
|
|
|
|
|
|
fn main() {}
|