rust/tests/target/trailing_commas.rs

103 lines
982 B
Rust
Raw Normal View History

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