]> git.lizzy.rs Git - rust.git/blob - tests/target/fn-simple.rs
Update 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
22 fn weird_comment(
23     // /*/ double level */ comment
24     x: Hello, // /*/* tripple, even */*/
25     // Does this work?
26     y: World,
27 ) {
28     simple(
29         // does this preserve comments now?
30         42,
31         NoWay,
32     )
33 }
34
35 fn generic<T>(arg: T) -> &SomeType
36 where
37     T: Fn(
38         // First arg
39         A,
40         // Second argument
41         B,
42         C,
43         D,
44         // pre comment
45         E, /* last comment */
46     ) -> &SomeType,
47 {
48     arg(a, b, c, d, e)
49 }
50
51 fn foo() -> ! {}
52
53 pub fn http_fetch_async(
54     listener: Box<AsyncCORSResponseListener + Send>,
55     script_chan: Box<ScriptChan + Send>,
56 ) {
57 }
58
59 fn some_func<T: Box<Trait + Bound>>(val: T) {}
60
61 fn zzzzzzzzzzzzzzzzzzzz<Type, NodeType>(
62     selff: Type,
63     mut handle: node::Handle<IdRef<'id, Node<K, V>>, Type, NodeType>,
64 ) -> SearchStack<'a, K, V, Type, NodeType> {
65 }
66
67 unsafe fn generic_call(
68     cx: *mut JSContext,
69     argc: libc::c_uint,
70     vp: *mut JSVal,
71     is_lenient: bool,
72     call: unsafe extern "C" fn(
73         *const JSJitInfo,
74         *mut JSContext,
75         HandleObject,
76         *mut libc::c_void,
77         u32,
78         *mut JSVal,
79     ) -> u8,
80 ) {
81     let f: fn(_, _) -> _ = panic!();
82 }
83
84 pub fn start_export_thread<C: CryptoSchemee + 'static>(
85     database: &Database,
86     crypto_scheme: &C,
87     block_size: usize,
88     source_path: &Path,
89 ) -> BonzoResult<mpsc::Consumer<'static, FileInstruction>> {
90 }
91
92 pub fn waltz(cwd: &Path) -> CliAssert {
93     {
94         {
95             formatted_comment =
96                 rewrite_comment(comment, block_style, width, offset, formatting_fig);
97         }
98     }
99
100 }