]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/empty_structs_with_brackets.rs
Merge commit 'f2cdd4a78d89c009342197cf5844a21f8aa813df' into sync_cg_clif-2022-04-22
[rust.git] / src / tools / clippy / tests / ui / empty_structs_with_brackets.rs
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() {}