summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/async_fn.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rustfmt/tests/target/async_fn.rs')
-rw-r--r--src/tools/rustfmt/tests/target/async_fn.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/target/async_fn.rs b/src/tools/rustfmt/tests/target/async_fn.rs
new file mode 100644
index 000000000..ac151dddb
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/async_fn.rs
@@ -0,0 +1,24 @@
+// rustfmt-edition: 2018
+
+async fn bar() -> Result<(), ()> {
+ Ok(())
+}
+
+pub async fn baz() -> Result<(), ()> {
+ Ok(())
+}
+
+async unsafe fn foo() {
+ async move { Ok(()) }
+}
+
+async unsafe fn rust() {
+ async move {
+ // comment
+ Ok(())
+ }
+}
+
+async fn await_try() {
+ something.await?;
+}