]> git.lizzy.rs Git - rust.git/blob - tests/source/fn-simple.rs
Merge pull request #641 from marcusklaas/fix-doc-commentz
[rust.git] / tests / source / fn-simple.rs
1
2 fn simple(/*pre-comment on a function!?*/ i: i32/*yes, it's possible!  */   
3                                         ,response: NoWay /* hose */) {
4 fn op(x: Typ, key : &[u8], upd : Box<Fn(Option<&memcache::Item>) -> (memcache::Status, Result<memcache::Item, Option<String>>)>) -> MapResult {}
5
6         "cool"}
7
8
9 fn weird_comment(/* /*/ double level */ comment */ x: Hello /*/*/* tripple, even */*/*/,
10 // Does this work?
11 y: World
12 ) {
13         simple(/* does this preserve comments now? */ 42, NoWay)
14 }
15
16 fn generic<T>(arg: T) -> &SomeType
17     where T: Fn(// First arg
18         A,
19         // Second argument
20         B, C, D, /* pre comment */ E /* last comment */) -> &SomeType {
21     arg(a, b, c, d, e)    
22 }
23
24 fn foo()  ->  !  {}
25
26 pub fn http_fetch_async(listener:Box< AsyncCORSResponseListener+Send >,  script_chan:  Box<ScriptChan+Send>) {
27 }
28
29 fn some_func<T:Box<Trait+Bound>>(val:T){}
30
31 fn zzzzzzzzzzzzzzzzzzzz<Type, NodeType>
32                        (selff: Type, mut handle: node::Handle<IdRef<'id, Node<K, V>>, Type, NodeType>)
33                         -> SearchStack<'a, K, V, Type, NodeType>{
34 }
35
36 unsafe fn generic_call(cx: *mut JSContext, argc: libc::c_uint, vp: *mut JSVal,
37     is_lenient: bool,
38                        call: unsafe extern fn(*const JSJitInfo, *mut JSContext,
39                                               HandleObject, *mut libc::c_void, u32,
40                                               *mut JSVal)
41                                               -> u8) {
42     let f:  fn  ( _ , _  ) ->  _   =  panic!()  ;
43 }