]> git.lizzy.rs Git - rust.git/blob - tests/ui/partial_pub_fields.rs
Auto merge of #9622 - llogiq:box-dyn-default, r=Alexendoo
[rust.git] / tests / ui / partial_pub_fields.rs
1 #![allow(unused)]
2 #![warn(clippy::partial_pub_fields)]
3
4 fn main() {
5     use std::collections::HashMap;
6
7     #[derive(Default)]
8     pub struct FileSet {
9         files: HashMap<String, u32>,
10         pub paths: HashMap<u32, String>,
11     }
12
13     pub struct Color {
14         pub r: u8,
15         pub g: u8,
16         b: u8,
17     }
18
19     pub struct Point(i32, pub i32);
20
21     pub struct Visibility {
22         r#pub: bool,
23         pub pos: u32,
24     }
25
26     // Don't lint on empty structs;
27     pub struct Empty1;
28     pub struct Empty2();
29     pub struct Empty3 {};
30
31     // Don't lint on structs with one field.
32     pub struct Single1(i32);
33     pub struct Single2(pub i32);
34     pub struct Single3 {
35         v1: i32,
36     }
37     pub struct Single4 {
38         pub v1: i32,
39     }
40 }