]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/source/comments-in-lists/wrap-comments-true.rs
Rollup merge of #100804 - GuillaumeGomez:search-results-color-ayu, r=notriddle
[rust.git] / src / tools / rustfmt / tests / source / 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 pipeline, or according to the descriptions
24     Variant1,
25     // Expand as needed, numbers should be ascending according to the stage through the inclusion pipeline, or according to the descriptions
26     Variant2,
27     // Expand as needed, numbers should be ascending according to the stage through the inclusion pipeline, or according to the descriptions
28
29 }
30
31 pub struct S {
32     // Expand as needed, numbers should be ascending according to the stage
33     // through the inclusion pipeline, or according to the descriptions
34     some_field: usize,
35     // Expand as needed, numbers should be ascending according to the stage
36     // through the inclusion pipeline, or according to the descriptions
37     last_field: usize,
38     // Expand as needed, numbers should be ascending according to the stage
39     // through the inclusion pipeline, or according to the descriptions
40 }
41
42 pub struct S2 {
43     // This can be changed once https://github.com/rust-lang/rustfmt/issues/4854 is fixed
44 // Expand as needed, numbers should be ascending according to the stage
45 // through the inclusion pipeline, or according to the descriptions
46 }
47
48 pub struct S3 {
49     // Expand as needed, numbers should be ascending according to the stage through the inclusion pipeline, or according to the descriptions
50     some_field: usize,
51     // Expand as needed, numbers should be ascending according to the stage through the inclusion pipeline, or according to the descriptions
52     last_field: usize,
53     // Expand as needed, numbers should be ascending according to the stage through the inclusion pipeline, or according to the descriptions
54 }
55
56 fn foo(
57     // Expand as needed, numbers should be ascending according to the stage
58     // through the inclusion pipeline, or according to the descriptions
59     a: usize,
60     // Expand as needed, numbers should be ascending according to the stage
61     // through the inclusion pipeline, or according to the descriptions
62     b: usize,
63     // Expand as needed, numbers should be ascending according to the stage
64     // through the inclusion pipeline, or according to the descriptions
65 ) -> usize {
66     5
67 }
68
69 fn foo2(// Expand as needed, numbers should be ascending according to the stage
70     // through the inclusion pipeline, or according to the descriptions
71 ) -> usize {
72     5
73 }
74
75 fn foo3(
76     // Expand as needed, numbers should be ascending according to the stage through the inclusion pipeline, or according to the descriptions
77     a: usize,
78     // Expand as needed, numbers should be ascending according to the stage through the inclusion pipeline, or according to the descriptions
79     b: usize,
80     // Expand as needed, numbers should be ascending according to the stage through the inclusion pipeline, or according to the descriptions
81
82 ) -> usize {
83     5
84 }
85
86 fn main() {
87     let v = vec![
88         // Expand as needed, numbers should be ascending according to the stage
89         // through the inclusion pipeline, or according to the descriptions
90         1,
91         // Expand as needed, numbers should be ascending according to the stage
92         // through the inclusion pipeline, or according to the descriptions
93         2,
94         // Expand as needed, numbers should be ascending according to the stage
95         // through the inclusion pipeline, or according to the descriptions
96     ];
97
98     let v2: Vec<i32> = vec![
99         // Expand as needed, numbers should be ascending according to the stage
100         // through the inclusion pipeline, or according to the descriptions
101     ];
102
103     let v3 = vec![
104         // Expand as needed, numbers should be ascending according to the stage through the inclusion pipeline, or according to the descriptions
105         1,
106         // Expand as needed, numbers should be ascending according to the stage through the inclusion pipeline, or according to the descriptions
107         2,
108         // Expand as needed, numbers should be ascending according to the stage through the inclusion pipeline, or according to the descriptions
109     ];
110
111     // https://github.com/rust-lang/rustfmt/issues/4430
112     match a {
113         // Expand as needed, numbers should be ascending according to the stage
114         // through the inclusion pipeline, or according to the descriptions
115         b => c,
116         // Expand as needed, numbers should be ascending according to the stage
117         // through the inclusion pipeline, or according to the descriptions
118         d => e,
119         // Expand as needed, numbers should be ascending according to the stage
120         // through the inclusion pipeline, or according to the descriptions
121     }
122
123     match a {
124         // Expand as needed, numbers should be ascending according to the stage through the inclusion pipeline, or according to the descriptions
125         b => c,
126         // Expand as needed, numbers should be ascending according to the stage through the inclusion pipeline, or according to the descriptions
127         d => e,
128         // Expand as needed, numbers should be ascending according to the stage through the inclusion pipeline, or according to the descriptions
129     }
130 }