]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/source/struct_field_doc_comment.rs
Rollup merge of #107166 - petrochenkov:nooptable, r=oli-obk
[rust.git] / src / tools / rustfmt / tests / source / struct_field_doc_comment.rs
1 // #5215
2 struct MyTuple(
3     /// Doc Comments
4     /* TODO note to add more to Doc Comments */ u32,
5     /// Doc Comments
6     // TODO note
7     u64,
8 );
9
10 struct MyTuple(
11     #[cfg(unix)] // some comment
12     u64,
13     #[cfg(not(unix))] /*block comment */
14     u32,
15 );
16
17 struct MyTuple(
18     #[cfg(unix)]
19     // some comment
20     u64,
21     #[cfg(not(unix))]
22     /*block comment */
23     u32,
24 );
25
26 struct MyTuple(
27     #[cfg(unix)] // some comment
28     pub u64,
29     #[cfg(not(unix))] /*block comment */
30     pub(crate) u32,
31 );
32
33 struct MyTuple(
34     /// Doc Comments
35     /* TODO note to add more to Doc Comments */
36     pub u32,
37     /// Doc Comments
38     // TODO note
39     pub(crate) u64,
40 );
41
42 struct MyStruct {
43     #[cfg(unix)] // some comment
44     a: u64,
45     #[cfg(not(unix))] /*block comment */
46     b: u32,
47 }
48
49 struct MyStruct {
50     #[cfg(unix)] // some comment
51     pub a: u64,
52     #[cfg(not(unix))] /*block comment */
53     pub(crate) b: u32,
54 }
55
56 struct MyStruct {
57     /// Doc Comments
58     /* TODO note to add more to Doc Comments */
59     a: u32,
60     /// Doc Comments
61     // TODO note
62     b: u64,
63 }
64
65 struct MyStruct {
66     /// Doc Comments
67     /* TODO note to add more to Doc Comments */
68     pub a: u32,
69     /// Doc Comments
70     // TODO note
71     pub(crate) b: u64,
72 }