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/target/fn-simple.rs | 120 ++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 src/tools/rustfmt/tests/target/fn-simple.rs (limited to 'src/tools/rustfmt/tests/target/fn-simple.rs') diff --git a/src/tools/rustfmt/tests/target/fn-simple.rs b/src/tools/rustfmt/tests/target/fn-simple.rs new file mode 100644 index 000000000..e72526936 --- /dev/null +++ b/src/tools/rustfmt/tests/target/fn-simple.rs @@ -0,0 +1,120 @@ +// rustfmt-normalize_comments: true + +fn simple( + // pre-comment on a function!? + i: i32, // yes, it's possible! + response: NoWay, // hose +) { + fn op( + x: Typ, + key: &[u8], + upd: Box< + Fn( + Option<&memcache::Item>, + ) -> (memcache::Status, Result>), + >, + ) -> MapResult { + } + + "cool" +} + +fn weird_comment( + // /*/ double level */ comment + x: Hello, // /*/* triple, even */*/ + // Does this work? + y: World, +) { + simple(/* does this preserve comments now? */ 42, NoWay) +} + +fn generic(arg: T) -> &SomeType +where + T: Fn( + // First arg + A, + // Second argument + B, + C, + D, + // pre comment + E, // last comment + ) -> &SomeType, +{ + arg(a, b, c, d, e) +} + +fn foo() -> ! {} + +pub fn http_fetch_async( + listener: Box, + script_chan: Box, +) { +} + +fn some_func>(val: T) {} + +fn zzzzzzzzzzzzzzzzzzzz( + selff: Type, + mut handle: node::Handle>, Type, NodeType>, +) -> SearchStack<'a, K, V, Type, NodeType> { +} + +unsafe fn generic_call( + cx: *mut JSContext, + argc: libc::c_uint, + vp: *mut JSVal, + is_lenient: bool, + call: unsafe extern "C" fn( + *const JSJitInfo, + *mut JSContext, + HandleObject, + *mut libc::c_void, + u32, + *mut JSVal, + ) -> u8, +) { + let f: fn(_, _) -> _ = panic!(); +} + +pub fn start_export_thread( + database: &Database, + crypto_scheme: &C, + block_size: usize, + source_path: &Path, +) -> BonzoResult> { +} + +pub fn waltz(cwd: &Path) -> CliAssert { + { + { + formatted_comment = + rewrite_comment(comment, block_style, width, offset, formatting_fig); + } + } +} + +// #2003 +mod foo { + fn __bindgen_test_layout_i_open0_c_open1_char_a_open2_char_close2_close1_close0_instantiation() + { + foo(); + } +} + +// #2082 +pub(crate) fn init() {} + +pub(crate) fn init() {} + +// #2630 +fn make_map String)>(records: &Vec, key_fn: F) -> HashMap {} + +// #2956 +fn bar( + beans: Asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf, + spam: bool, + eggs: bool, +) -> bool { + unimplemented!(); +} -- cgit v1.2.3