summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/async_closure.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rustfmt/tests/target/async_closure.rs')
-rw-r--r--src/tools/rustfmt/tests/target/async_closure.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/target/async_closure.rs b/src/tools/rustfmt/tests/target/async_closure.rs
new file mode 100644
index 000000000..9364e7dcc
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/async_closure.rs
@@ -0,0 +1,22 @@
+// rustfmt-edition: 2018
+
+fn main() {
+ let async_closure = async {
+ let x = 3;
+ x
+ };
+
+ let f = async /* comment */ {
+ let x = 3;
+ x
+ };
+
+ let g = async /* comment */ move {
+ let x = 3;
+ x
+ };
+
+ let f = |x| async {
+ println!("hello, world");
+ };
+}