2017-03-02 14:25:57 +13:00
|
|
|
// rustfmt-match_block_trailing_comma: true
|
2017-02-24 10:43:53 +13:00
|
|
|
// rustfmt-trailing_comma: Always
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
match foo {
|
|
|
|
x => {},
|
|
|
|
y => {
|
|
|
|
foo();
|
|
|
|
},
|
|
|
|
_ => x,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-07 15:49:15 +09:00
|
|
|
fn f<S, T,>(x: T, y: S,) -> T
|
2017-06-12 16:01:41 +12:00
|
|
|
where
|
|
|
|
T: P,
|
|
|
|
S: Q,
|
2017-02-24 10:43:53 +13:00
|
|
|
{
|
|
|
|
x
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Trait for T
|
2017-06-12 16:01:41 +12:00
|
|
|
where
|
|
|
|
T: P,
|
2017-02-24 10:43:53 +13:00
|
|
|
{
|
2019-03-14 22:50:53 +09:00
|
|
|
fn f(x: T,) -> T
|
2017-06-12 16:01:41 +12:00
|
|
|
where
|
|
|
|
T: Q + R,
|
2017-02-24 10:43:53 +13:00
|
|
|
{
|
|
|
|
x
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-07 15:49:15 +09:00
|
|
|
struct Pair<S, T,>
|
|
|
|
where
|
2017-06-12 16:01:41 +12:00
|
|
|
T: P,
|
|
|
|
S: P + Q,
|
2017-02-24 10:43:53 +13:00
|
|
|
{
|
|
|
|
a: T,
|
|
|
|
b: S,
|
|
|
|
}
|
|
|
|
|
2018-03-07 15:49:15 +09:00
|
|
|
struct TupPair<S, T,>(S, T,)
|
2017-06-12 16:01:41 +12:00
|
|
|
where
|
|
|
|
T: P,
|
|
|
|
S: P + Q;
|
2017-02-24 10:43:53 +13:00
|
|
|
|
2018-03-07 15:49:15 +09:00
|
|
|
enum E<S, T,>
|
|
|
|
where
|
2017-06-12 16:01:41 +12:00
|
|
|
S: P,
|
|
|
|
T: P,
|
2017-02-24 10:43:53 +13:00
|
|
|
{
|
|
|
|
A { a: T, },
|
|
|
|
}
|
|
|
|
|
2018-03-07 15:49:15 +09:00
|
|
|
type Double<T,>
|
|
|
|
where
|
2017-06-12 16:01:41 +12:00
|
|
|
T: P,
|
2017-08-02 23:28:52 +09:00
|
|
|
T: Q,
|
2018-03-07 15:49:15 +09:00
|
|
|
= Pair<T, T,>;
|
2017-02-24 10:43:53 +13:00
|
|
|
|
|
|
|
extern "C" {
|
2018-03-07 15:49:15 +09:00
|
|
|
fn f<S, T,>(x: T, y: S,) -> T
|
2017-06-12 16:01:41 +12:00
|
|
|
where
|
|
|
|
T: P,
|
|
|
|
S: Q;
|
2017-02-24 10:43:53 +13:00
|
|
|
}
|
|
|
|
|
2018-03-07 15:49:15 +09:00
|
|
|
trait Q<S, T,>
|
|
|
|
where
|
2017-06-12 16:01:41 +12:00
|
|
|
T: P,
|
|
|
|
S: R,
|
2017-02-24 10:43:53 +13:00
|
|
|
{
|
2018-03-07 15:49:15 +09:00
|
|
|
fn f<U, V,>(self, x: T, y: S, z: U,) -> Self
|
2017-06-12 16:01:41 +12:00
|
|
|
where
|
|
|
|
U: P,
|
|
|
|
V: P;
|
2017-02-24 10:43:53 +13:00
|
|
|
}
|