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