]> git.lizzy.rs Git - rust.git/blob - tests/source/fn-simple.rs
chore: bump toolchain
[rust.git] / tests / source / fn-simple.rs
1 // rustfmt-normalize_comments: true
2
3 fn simple(/*pre-comment on a function!?*/ i: i32/*yes, it's possible!  */   
4                                         ,response: NoWay /* hose */) {
5 fn op(x: Typ, key : &[u8], upd : Box<Fn(Option<&memcache::Item>) -> (memcache::Status, Result<memcache::Item, Option<String>>)>) -> MapResult {}
6
7         "cool"}
8
9
10 fn weird_comment(/* /*/ double level */ comment */ x: Hello /*/*/* triple, even */*/*/,
11 // Does this work?
12 y: World
13 ) {
14         simple(/* does this preserve comments now? */ 42, NoWay)
15 }
16
17 fn generic<T>(arg: T) -> &SomeType
18     where T: Fn(// First arg
19         A,
20         // Second argument
21         B, C, D, /* pre comment */ E /* last comment */) -> &SomeType {
22     arg(a, b, c, d, e)
23 }
24
25 fn foo()  ->  !  {}
26
27 pub fn http_fetch_async(listener:Box< AsyncCORSResponseListener+Send >,  script_chan:  Box<ScriptChan+Send>) {
28 }
29
30 fn some_func<T:Box<Trait+Bound>>(val:T){}
31
32 fn zzzzzzzzzzzzzzzzzzzz<Type, NodeType>
33                        (selff: Type, mut handle: node::Handle<IdRef<'id, Node<K, V>>, Type, NodeType>)
34                         -> SearchStack<'a, K, V, Type, NodeType>{
35 }
36
37 unsafe fn generic_call(cx: *mut JSContext, argc: libc::c_uint, vp: *mut JSVal,
38     is_lenient: bool,
39                        call: unsafe extern fn(*const JSJitInfo, *mut JSContext,
40                                               HandleObject, *mut libc::c_void, u32,
41                                               *mut JSVal)
42                                               -> u8) {
43     let f:  fn  ( _ , _  ) ->  _   =  panic!()  ;
44 }
45
46 pub fn start_export_thread<C: CryptoSchemee + 'static>(database: &Database, crypto_scheme: &C, block_size: usize, source_path: &Path) -> BonzoResult<mpsc::Consumer<'static, FileInstruction>> {}
47
48 pub fn waltz(cwd: &Path) -> CliAssert {
49     {
50         {
51             formatted_comment = rewrite_comment(comment, block_style, width, offset, formatting_fig);
52         }
53     }
54 }
55
56 // #2003
57 mod foo {
58     fn __bindgen_test_layout_i_open0_c_open1_char_a_open2_char_close2_close1_close0_instantiation() {
59         foo();
60     }
61 }
62
63 // #2082
64 pub(crate) fn init() {}
65
66 crate fn init() {}
67
68 // #2630
69 fn make_map<T, F: (Fn(&T) -> String)>(records: &Vec<T>, key_fn: F) -> HashMap<String, usize> {}
70
71 // #2956
72 fn bar(beans: Asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf, spam: bool, eggs: bool) -> bool{
73     unimplemented!();
74 }