summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/source/issue-3198.rs
blob: 48cb24a00259edaff855c4e632c393db0379761a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
impl TestTrait {
    fn foo_one_pre(/* Important comment1 */
    self) {
    }

    fn foo_one_post(self
    /* Important comment1 */) {
    }

    fn foo_pre(
        /* Important comment1 */
        self,
        /* Important comment2 */
        a: i32,
    ) {
    }

    fn foo_post(
        self
        /* Important comment1 */,
        a: i32
        /* Important comment2 */,
    ) {
    }

    fn bar_pre(
            /* Important comment1 */
    &mut self,
        /* Important comment2 */
            a: i32,
    ) {
    }

    fn bar_post(
    &mut self
            /* Important comment1 */,
            a: i32
        /* Important comment2 */,
    ) {
    }

    fn baz_pre(
    /* Important comment1 */
            self: X< 'a ,  'b >,
            /* Important comment2 */
    a: i32,
    ) {
    }

    fn baz_post(
            self: X< 'a ,  'b >
    /* Important comment1 */,
    a: i32
            /* Important comment2 */,
    ) {
    }

    fn baz_tree_pre(
    /* Important comment1 */
            self: X< 'a ,  'b >,
        /* Important comment2 */
        a: i32,
        /* Important comment3 */
        b: i32,
    ) {
    }

    fn baz_tree_post(
            self: X< 'a ,  'b >
    /* Important comment1 */,
        a: i32
        /* Important comment2 */,
        b: i32
        /* Important comment3 */,){
    }

    fn multi_line(
        self: X<'a, 'b>, /* Important comment1-1 */
  /* Important comment1-2 */
        a: i32, /* Important comment2 */
        b: i32, /* Important comment3 */
    ) {
    }

    fn two_line_comment(
        self: X<'a, 'b>, /* Important comment1-1
      Important comment1-2 */
        a: i32, /* Important comment2 */
        b: i32, /* Important comment3 */
    ) {
    }

    fn no_first_line_comment(
        self: X<'a, 'b>,
        /* Important comment2 */a: i32,
        /* Important comment3 */b: i32,
    ) {
    }
}