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