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