]> git.lizzy.rs Git - rust.git/blob - tests/target/trailing_commas.rs
Merge branch 'master' of github.com:rust-lang-nursery/rustfmt
[rust.git] / tests / target / trailing_commas.rs
1 // rustfmt-trailing_comma: Always
2
3 fn main() {
4     match foo {
5         x => {},
6         y => {
7             foo();
8         },
9         _ => x,
10     }
11 }
12
13 fn f<S, T>(x: T, y: S) -> T
14     where T: P,
15           S: Q,
16 {
17     x
18 }
19
20 impl Trait for T
21     where T: P,
22 {
23     fn f(x: T) -> T
24         where T: Q + R,
25     {
26         x
27     }
28 }
29
30 struct Pair<S, T>
31     where T: P,
32           S: P + Q,
33 {
34     a: T,
35     b: S,
36 }
37
38 struct TupPair<S, T>(S, T)
39     where T: P,
40           S: P + Q;
41
42 enum E<S, T>
43     where S: P,
44           T: P,
45 {
46     A { a: T, },
47 }
48
49 type Double<T>
50     where T: P,
51           T: Q = Pair<T, T>;
52
53 extern "C" {
54     fn f<S, T>(x: T, y: S) -> T
55         where T: P,
56               S: Q;
57 }
58
59 trait Q<S, T>
60     where T: P,
61           S: R,
62 {
63     fn f<U, V>(self, x: T, y: S, z: U) -> Self
64         where U: P,
65               V: P;
66 }