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