]> git.lizzy.rs Git - rust.git/blob - tests/target/trailing_commas.rs
Merge pull request #1848 from topecongiro/refactor-rewrite-where-clause
[rust.git] / tests / target / trailing_commas.rs
1 // rustfmt-match_block_trailing_comma: true
2 // rustfmt-trailing_comma: Always
3
4 fn main() {
5     match foo {
6         x => {},
7         y => {
8             foo();
9         },
10         _ => x,
11     }
12 }
13
14 fn f<
15     S, T,
16 >(
17     x: T,
18     y: S,
19 ) -> T
20 where
21     T: P,
22     S: Q,
23 {
24     x
25 }
26
27 impl Trait for T
28 where
29     T: P,
30 {
31     fn f(x: T) -> T
32     where
33         T: Q + R,
34     {
35         x
36     }
37 }
38
39 struct Pair<
40     S, T,
41 > where
42     T: P,
43     S: P + Q,
44 {
45     a: T,
46     b: S,
47 }
48
49 struct TupPair<
50     S, T,
51 >(S, T,)
52 where
53     T: P,
54     S: P + Q;
55
56 enum E<
57     S, T,
58 > where
59     S: P,
60     T: P,
61 {
62     A { a: T, },
63 }
64
65 type Double<
66     T,
67 > where
68     T: P,
69     T: Q,
70 = Pair<
71     T, T,
72 >;
73
74 extern "C" {
75     fn f<
76         S, T,
77     >(
78         x: T,
79         y: S,
80     ) -> T
81     where
82         T: P,
83         S: Q;
84 }
85
86 trait Q<
87     S, T,
88 > where
89     T: P,
90     S: R,
91 {
92     fn f<
93         U, V,
94     >(
95         self,
96         x: T,
97         y: S,
98         z: U,
99     ) -> Self
100     where
101         U: P,
102         V: P;
103 }