]> git.lizzy.rs Git - rust.git/blob - tests/target/trailing_commas.rs
c5e6b9525b49b6a4ba11154ea0d05b2f46246e75
[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 = Pair<
70     T, T,
71 >;
72
73 extern "C" {
74     fn f<
75         S, T,
76     >(
77         x: T,
78         y: S,
79     ) -> T
80     where
81         T: P,
82         S: Q;
83 }
84
85 trait Q<
86     S, T,
87 > where
88     T: P,
89     S: R,
90 {
91     fn f<
92         U, V,
93     >(
94         self,
95         x: T,
96         y: S,
97         z: U,
98     ) -> Self
99     where
100         U: P,
101         V: P;
102 }