rust/tests/target/trailing_commas.rs

79 lines
843 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,
}
}
2018-03-07 07:49:15 +01: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
}
}
2018-03-07 07:49:15 +01: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,
}
2018-03-07 07:49:15 +01:00
struct TupPair<S, T,>(S, T,)
2017-06-12 06:01:41 +02:00
where
T: P,
S: P + Q;
2017-02-23 22:43:53 +01:00
2018-03-07 07:49:15 +01: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, },
}
2018-03-07 07:49:15 +01:00
type Double<T,>
where
2017-06-12 06:01:41 +02:00
T: P,
2017-08-02 16:28:52 +02:00
T: Q,
2018-03-07 07:49:15 +01:00
= Pair<T, T,>;
2017-02-23 22:43:53 +01:00
extern "C" {
2018-03-07 07:49:15 +01: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
}
2018-03-07 07:49:15 +01: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
{
2018-03-07 07:49:15 +01: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
}