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