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