]> git.lizzy.rs Git - rust.git/blob - tests/ui/empty_structs_with_brackets.fixed
Auto merge of #9684 - kraktus:ref_option_ref, r=xFrednet
[rust.git] / tests / ui / empty_structs_with_brackets.fixed
1 // run-rustfix
2 #![warn(clippy::empty_structs_with_brackets)]
3 #![allow(dead_code)]
4
5 pub struct MyEmptyStruct; // should trigger lint
6 struct MyEmptyTupleStruct; // should trigger lint
7
8 // should not trigger lint
9 struct MyCfgStruct {
10     #[cfg(feature = "thisisneverenabled")]
11     field: u8,
12 }
13
14 // should not trigger lint
15 struct MyCfgTupleStruct(#[cfg(feature = "thisisneverenabled")] u8);
16
17 // should not trigger lint
18 struct MyStruct {
19     field: u8,
20 }
21 struct MyTupleStruct(usize, String); // should not trigger lint
22 struct MySingleTupleStruct(usize); // should not trigger lint
23 struct MyUnitLikeStruct; // should not trigger lint
24
25 fn main() {}