]> git.lizzy.rs Git - rust.git/blob - tests/target/trailing_commas.rs
Fix trailing comma tests
[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<S, T>(x: T, y: S) -> T
15     where T: P,
16           S: Q,
17 {
18     x
19 }
20
21 impl Trait for T
22     where T: P,
23 {
24     fn f(x: T) -> T
25         where T: Q + R,
26     {
27         x
28     }
29 }
30
31 struct Pair<S, T>
32     where T: P,
33           S: P + Q,
34 {
35     a: T,
36     b: S,
37 }
38
39 struct TupPair<S, T>(S, T)
40     where T: P,
41           S: P + Q;
42
43 enum E<S, T>
44     where S: P,
45           T: P,
46 {
47     A { a: T, },
48 }
49
50 type Double<T>
51     where T: P,
52           T: Q = Pair<T, T>;
53
54 extern "C" {
55     fn f<S, T>(x: T, y: S) -> T
56         where T: P,
57               S: Q;
58 }
59
60 trait Q<S, T>
61     where T: P,
62           S: R,
63 {
64     fn f<U, V>(self, x: T, y: S, z: U) -> Self
65         where U: P,
66               V: P;
67 }