From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/tools/rustfmt/tests/source/trailing_commas.rs | 47 +++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/tools/rustfmt/tests/source/trailing_commas.rs (limited to 'src/tools/rustfmt/tests/source/trailing_commas.rs') diff --git a/src/tools/rustfmt/tests/source/trailing_commas.rs b/src/tools/rustfmt/tests/source/trailing_commas.rs new file mode 100644 index 000000000..3e5fcc808 --- /dev/null +++ b/src/tools/rustfmt/tests/source/trailing_commas.rs @@ -0,0 +1,47 @@ +// rustfmt-match_block_trailing_comma: true +// rustfmt-trailing_comma: Always + +fn main() { + match foo { + x => {} + y => { + foo(); + } + _ => x + } +} + +fn f(x: T, y: S) -> T where T: P, S: Q +{ + x +} + +impl Trait for T where T: P +{ + fn f(x: T) -> T where T: Q + R + { + x + } +} + +struct Pair where T: P, S: P + Q { + a: T, + b: S +} + +struct TupPair (S, T) where T: P, S: P + Q; + +enum E where S: P, T: P { + A {a: T}, +} + +type Double where T: P, T: Q = Pair; + +extern "C" { + fn f(x: T, y: S) -> T where T: P, S: Q; +} + +trait Q where T: P, S: R +{ + fn f(self, x: T, y: S, z: U) -> Self where U: P, V: P; +} -- cgit v1.2.3