]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/source/issue-3198.rs
Rollup merge of #107166 - petrochenkov:nooptable, r=oli-obk
[rust.git] / src / tools / rustfmt / tests / source / issue-3198.rs
1 impl TestTrait {
2     fn foo_one_pre(/* Important comment1 */
3     self) {
4     }
5
6     fn foo_one_post(self
7     /* Important comment1 */) {
8     }
9
10     fn foo_pre(
11         /* Important comment1 */
12         self,
13         /* Important comment2 */
14         a: i32,
15     ) {
16     }
17
18     fn foo_post(
19         self
20         /* Important comment1 */,
21         a: i32
22         /* Important comment2 */,
23     ) {
24     }
25
26     fn bar_pre(
27             /* Important comment1 */
28     &mut self,
29         /* Important comment2 */
30             a: i32,
31     ) {
32     }
33
34     fn bar_post(
35     &mut self
36             /* Important comment1 */,
37             a: i32
38         /* Important comment2 */,
39     ) {
40     }
41
42     fn baz_pre(
43     /* Important comment1 */
44             self: X< 'a ,  'b >,
45             /* Important comment2 */
46     a: i32,
47     ) {
48     }
49
50     fn baz_post(
51             self: X< 'a ,  'b >
52     /* Important comment1 */,
53     a: i32
54             /* Important comment2 */,
55     ) {
56     }
57
58     fn baz_tree_pre(
59     /* Important comment1 */
60             self: X< 'a ,  'b >,
61         /* Important comment2 */
62         a: i32,
63         /* Important comment3 */
64         b: i32,
65     ) {
66     }
67
68     fn baz_tree_post(
69             self: X< 'a ,  'b >
70     /* Important comment1 */,
71         a: i32
72         /* Important comment2 */,
73         b: i32
74         /* Important comment3 */,){
75     }
76
77     fn multi_line(
78         self: X<'a, 'b>, /* Important comment1-1 */
79   /* Important comment1-2 */
80         a: i32, /* Important comment2 */
81         b: i32, /* Important comment3 */
82     ) {
83     }
84
85     fn two_line_comment(
86         self: X<'a, 'b>, /* Important comment1-1
87       Important comment1-2 */
88         a: i32, /* Important comment2 */
89         b: i32, /* Important comment3 */
90     ) {
91     }
92
93     fn no_first_line_comment(
94         self: X<'a, 'b>,
95         /* Important comment2 */a: i32,
96         /* Important comment3 */b: i32,
97     ) {
98     }
99 }