rust/tests/target/trailing_commas.rs

103 lines
982 B
Rust
Raw Normal View History

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,
}
}
2017-06-12 21:49:47 -05: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
{
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
}
}
2017-06-12 21:49:47 -05: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,
}
2017-06-12 21:49:47 -05:00
struct TupPair<
S, T,
2017-06-24 05:49:01 -05:00
>(S, T,)
2017-06-11 23:01:41 -05:00
where
T: P,
S: P + Q;
2017-02-23 15:43:53 -06:00
2017-06-12 21:49:47 -05: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, },
}
2017-06-12 21:49:47 -05:00
type Double<
T,
> where
2017-06-11 23:01:41 -05:00
T: P,
2017-06-12 21:49:47 -05:00
T: Q = Pair<
T, T,
>;
2017-02-23 15:43:53 -06:00
extern "C" {
2017-06-12 21:49:47 -05: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
}
2017-06-12 21:49:47 -05: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
{
2017-06-12 21:49:47 -05: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
}