]> git.proxmox.com Git - rustc.git/blob - src/tools/rustfmt/tests/source/async_block.rs
New upstream version 1.59.0+dfsg1
[rustc.git] / src / tools / rustfmt / tests / source / async_block.rs
1 // rustfmt-edition: 2018
2
3 fn main() {
4 let x = async {
5 Ok(())
6 };
7 }
8
9 fn baz() {
10 // test
11 let x = async {
12 // async blocks are great
13 Ok(())
14 };
15
16 let y = async {
17 Ok(())
18 }; // comment
19
20 spawn(
21 a,
22 async move {
23 action();
24 Ok(())
25 },
26 );
27
28 spawn(
29 a,
30 async move || {
31 action();
32 Ok(())
33 },
34 );
35
36 spawn(
37 a,
38 static async || {
39 action();
40 Ok(())
41 },
42 );
43
44 spawn(
45 a,
46 static async move || {
47 action();
48 Ok(())
49 },
50 );
51 }