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 --- .../rustfmt/tests/target/fn_args_indent-block.rs | 143 +++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 src/tools/rustfmt/tests/target/fn_args_indent-block.rs (limited to 'src/tools/rustfmt/tests/target/fn_args_indent-block.rs') diff --git a/src/tools/rustfmt/tests/target/fn_args_indent-block.rs b/src/tools/rustfmt/tests/target/fn_args_indent-block.rs new file mode 100644 index 000000000..f5232a488 --- /dev/null +++ b/src/tools/rustfmt/tests/target/fn_args_indent-block.rs @@ -0,0 +1,143 @@ +// rustfmt-normalize_comments: true + +fn foo() { + foo(); +} + +fn foo(a: Aaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbb) { + foo(); +} + +fn bar( + a: Aaaaaaaaaaaaaa, + b: Bbbbbbbbbbbbbb, + c: Cccccccccccccccccc, + d: Dddddddddddddddd, + e: Eeeeeeeeeeeeeee, +) { + bar(); +} + +fn foo(a: Aaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbb) -> String { + foo(); +} + +fn bar( + a: Aaaaaaaaaaaaaa, + b: Bbbbbbbbbbbbbb, + c: Cccccccccccccccccc, + d: Dddddddddddddddd, + e: Eeeeeeeeeeeeeee, +) -> String { + bar(); +} + +fn foo(a: u8 /* Comment 1 */, b: u8 /* Comment 2 */) -> u8 { + bar() +} + +fn foo( + a: u8, // Comment 1 + b: Bbbbbbbbbbbbbb, + c: Cccccccccccccccccc, + d: Dddddddddddddddd, + e: Eeeeeeeeeeeeeee, // Comment 2 +) -> u8 { + bar() +} + +fn bar( + a: Aaaaaaaaaaaaaa, + b: Bbbbbbbbbbbbbb, + c: Cccccccccccccccccc, + d: Dddddddddddddddd, + e: Eeeeeeeeeeeeeee, +) -> String +where + X: Fooooo, + Y: Baaar, +{ + bar(); +} + +fn foo() -> T { + foo(); +} + +fn foo() -> T +where + X: Foooo, + Y: Baaar, +{ + foo(); +} + +fn foo() +where + X: Foooo, +{ +} + +fn foo() +where + X: Foooo, + Y: Baaar, +{ +} + +fn foo() -> ( + Loooooooooooooooooooooong, + Reeeeeeeeeeeeeeeeeeeeeeeeturn, + iiiiiiiiis, + Looooooooooooooooong, +) { + foo(); +} + +fn foo() { + foo(); +} + +fn foo< + L: Loooooooooooooooooooooong, + G: Geeeeeeeeeeeneric, + I: iiiiiiiiis, + L: Looooooooooooooooong, +>() { + foo(); +} + +fn foo() { + foo(); +} + +trait Test { + fn foo(a: u8) {} + + fn bar( + a: Aaaaaaaaaaaaaa, + b: Bbbbbbbbbbbbbb, + c: Cccccccccccccccccc, + d: Dddddddddddddddd, + e: Eeeeeeeeeeeeeee, + ) -> String { + } +} + +fn foo( + a: Aaaaaaaaaaaaaaaaaaaa, + b: Bbbbbbbbbbbbbbbbb, + c: Cccccccccccccccccc, + d: Dddddddddddddddd, +) { + foo(); +} + +fn foo() -> ( + Looooooooooooooooooooooooooong, + Reeeeeeeeeeeeeeeeeeeeeeeeeeeeeturn, + iiiiiiiiiiiiiis, + Loooooooooooooooooooooong, +) { + foo(); +} -- cgit v1.2.3