]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/comments-in-lists/wrap-comments-true.rs
Merge commit '39683d8eb7a32a74bea96ecbf1e87675d3338506' into sync_cg_gcc-2022-03-26
[rust.git] / src / tools / rustfmt / tests / target / comments-in-lists / wrap-comments-true.rs
1 // rustfmt-normalize_comments: true
2 // rustfmt-wrap_comments: true
3
4 // https://github.com/rust-lang/rustfmt/issues/4909
5 pub enum E {
6     // Expand as needed, numbers should be ascending according to the stage
7     // through the inclusion pipeline, or according to the descriptions
8     Variant1,
9     // Expand as needed, numbers should be ascending according to the stage
10     // through the inclusion pipeline, or according to the descriptions
11     Variant2,
12     // Expand as needed, numbers should be ascending according to the stage
13     // through the inclusion pipeline, or according to the descriptions
14 }
15
16 pub enum E2 {
17     // This can be changed once https://github.com/rust-lang/rustfmt/issues/4854 is fixed
18 // Expand as needed, numbers should be ascending according to the stage
19 // through the inclusion pipeline, or according to the descriptions
20 }
21
22 pub enum E3 {
23     // Expand as needed, numbers should be ascending according to the stage through the inclusion
24     // pipeline, or according to the descriptions
25     Variant1,
26     // Expand as needed, numbers should be ascending according to the stage through the inclusion
27     // pipeline, or according to the descriptions
28     Variant2,
29     // Expand as needed, numbers should be ascending according to the stage through the inclusion
30     // pipeline, or according to the descriptions
31 }
32
33 pub struct S {
34     // Expand as needed, numbers should be ascending according to the stage
35     // through the inclusion pipeline, or according to the descriptions
36     some_field: usize,
37     // Expand as needed, numbers should be ascending according to the stage
38     // through the inclusion pipeline, or according to the descriptions
39     last_field: usize,
40     // Expand as needed, numbers should be ascending according to the stage
41     // through the inclusion pipeline, or according to the descriptions
42 }
43
44 pub struct S2 {
45     // This can be changed once https://github.com/rust-lang/rustfmt/issues/4854 is fixed
46 // Expand as needed, numbers should be ascending according to the stage
47 // through the inclusion pipeline, or according to the descriptions
48 }
49
50 pub struct S3 {
51     // Expand as needed, numbers should be ascending according to the stage through the inclusion
52     // pipeline, or according to the descriptions
53     some_field: usize,
54     // Expand as needed, numbers should be ascending according to the stage through the inclusion
55     // pipeline, or according to the descriptions
56     last_field: usize,
57     // Expand as needed, numbers should be ascending according to the stage through the inclusion
58     // pipeline, or according to the descriptions
59 }
60
61 fn foo(
62     // Expand as needed, numbers should be ascending according to the stage
63     // through the inclusion pipeline, or according to the descriptions
64     a: usize,
65     // Expand as needed, numbers should be ascending according to the stage
66     // through the inclusion pipeline, or according to the descriptions
67     b: usize,
68     // Expand as needed, numbers should be ascending according to the stage
69     // through the inclusion pipeline, or according to the descriptions
70 ) -> usize {
71     5
72 }
73
74 fn foo2(// Expand as needed, numbers should be ascending according to the stage
75     // through the inclusion pipeline, or according to the descriptions
76 ) -> usize {
77     5
78 }
79
80 fn foo3(
81     // Expand as needed, numbers should be ascending according to the stage through the inclusion
82     // pipeline, or according to the descriptions
83     a: usize,
84     // Expand as needed, numbers should be ascending according to the stage through the inclusion
85     // pipeline, or according to the descriptions
86     b: usize,
87     // Expand as needed, numbers should be ascending according to the stage through the inclusion
88     // pipeline, or according to the descriptions
89 ) -> usize {
90     5
91 }
92
93 fn main() {
94     let v = vec![
95         // Expand as needed, numbers should be ascending according to the stage
96         // through the inclusion pipeline, or according to the descriptions
97         1,
98         // Expand as needed, numbers should be ascending according to the stage
99         // through the inclusion pipeline, or according to the descriptions
100         2,
101         // Expand as needed, numbers should be ascending according to the stage
102         // through the inclusion pipeline, or according to the descriptions
103     ];
104
105     let v2: Vec<i32> = vec![
106         // Expand as needed, numbers should be ascending according to the stage
107         // through the inclusion pipeline, or according to the descriptions
108     ];
109
110     let v3 = vec![
111         // Expand as needed, numbers should be ascending according to the stage through the
112         // inclusion pipeline, or according to the descriptions
113         1,
114         // Expand as needed, numbers should be ascending according to the stage through the
115         // inclusion pipeline, or according to the descriptions
116         2,
117         // Expand as needed, numbers should be ascending according to the stage through the
118         // inclusion pipeline, or according to the descriptions
119     ];
120
121     // https://github.com/rust-lang/rustfmt/issues/4430
122     match a {
123         // Expand as needed, numbers should be ascending according to the stage
124         // through the inclusion pipeline, or according to the descriptions
125         b => c,
126         // Expand as needed, numbers should be ascending according to the stage
127         // through the inclusion pipeline, or according to the descriptions
128         d => e,
129         // Expand as needed, numbers should be ascending according to the stage
130         // through the inclusion pipeline, or according to the descriptions
131     }
132
133     match a {
134         // Expand as needed, numbers should be ascending according to the stage through the
135         // inclusion pipeline, or according to the descriptions
136         b => c,
137         // Expand as needed, numbers should be ascending according to the stage through the
138         // inclusion pipeline, or according to the descriptions
139         d => e,
140         // Expand as needed, numbers should be ascending according to the stage through the
141         // inclusion pipeline, or according to the descriptions
142     }
143 }