]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/struct_field_doc_comment.rs
:arrow_up: rust-analyzer
[rust.git] / src / tools / rustfmt / tests / target / struct_field_doc_comment.rs
1 // #5215
2 struct MyTuple(
3     /// Doc Comments
4     /* TODO note to add more to Doc Comments */
5     u32,
6     /// Doc Comments
7     // TODO note
8     u64,
9 );
10
11 struct MyTuple(
12     #[cfg(unix)] // some comment
13     u64,
14     #[cfg(not(unix))] /*block comment */ 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 */ pub(crate)  u32,
30 );
31
32 struct MyTuple(
33     /// Doc Comments
34     /* TODO note to add more to Doc Comments */
35     pub  u32,
36     /// Doc Comments
37     // TODO note
38     pub(crate)  u64,
39 );
40
41 struct MyStruct {
42     #[cfg(unix)] // some comment
43     a: u64,
44     #[cfg(not(unix))] /*block comment */ b: u32,
45 }
46
47 struct MyStruct {
48     #[cfg(unix)] // some comment
49     pub a: u64,
50     #[cfg(not(unix))] /*block comment */ pub(crate) b: u32,
51 }
52
53 struct MyStruct {
54     /// Doc Comments
55     /* TODO note to add more to Doc Comments */
56     a: u32,
57     /// Doc Comments
58     // TODO note
59     b: u64,
60 }
61
62 struct MyStruct {
63     /// Doc Comments
64     /* TODO note to add more to Doc Comments */
65     pub a: u32,
66     /// Doc Comments
67     // TODO note
68     pub(crate) b: u64,
69 }