summaryrefslogtreecommitdiffstats
path: root/src/test/ui/async-await/unnecessary-await.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/async-await/unnecessary-await.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/async-await/unnecessary-await.rs b/src/test/ui/async-await/unnecessary-await.rs
new file mode 100644
index 000000000..24673777b
--- /dev/null
+++ b/src/test/ui/async-await/unnecessary-await.rs
@@ -0,0 +1,14 @@
+// edition:2018
+
+async fn foo () { }
+fn bar() -> impl std::future::Future { async {} }
+fn boo() {}
+
+async fn baz() -> std::io::Result<()> {
+ foo().await;
+ boo().await; //~ ERROR `()` is not a future
+ bar().await;
+ std::io::Result::Ok(())
+}
+
+fn main() {}