about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/ui/async_yields_async.fixed7
-rw-r--r--tests/ui/async_yields_async.rs7
-rw-r--r--tests/ui/async_yields_async.stderr12
3 files changed, 20 insertions, 6 deletions
diff --git a/tests/ui/async_yields_async.fixed b/tests/ui/async_yields_async.fixed
index cadc6494c76..9b1a7ac3ba9 100644
--- a/tests/ui/async_yields_async.fixed
+++ b/tests/ui/async_yields_async.fixed
@@ -22,6 +22,12 @@ fn custom_future_type_ctor() -> CustomFutureType {
     CustomFutureType
 }
 
+async fn f() -> CustomFutureType {
+    // Don't warn for functions since you have to explicitly declare their
+    // return types.
+    CustomFutureType
+}
+
 #[rustfmt::skip]
 fn main() {
     let _f = {
@@ -58,4 +64,5 @@ fn main() {
         CustomFutureType.await
     };
     let _n = async || custom_future_type_ctor();
+    let _o = async || f();
 }
diff --git a/tests/ui/async_yields_async.rs b/tests/ui/async_yields_async.rs
index 898fe1a9561..731c094edb4 100644
--- a/tests/ui/async_yields_async.rs
+++ b/tests/ui/async_yields_async.rs
@@ -22,6 +22,12 @@ fn custom_future_type_ctor() -> CustomFutureType {
     CustomFutureType
 }
 
+async fn f() -> CustomFutureType {
+    // Don't warn for functions since you have to explicitly declare their
+    // return types.
+    CustomFutureType
+}
+
 #[rustfmt::skip]
 fn main() {
     let _f = {
@@ -58,4 +64,5 @@ fn main() {
         CustomFutureType
     };
     let _n = async || custom_future_type_ctor();
+    let _o = async || f();
 }
diff --git a/tests/ui/async_yields_async.stderr b/tests/ui/async_yields_async.stderr
index 112984cdccb..17d0c375106 100644
--- a/tests/ui/async_yields_async.stderr
+++ b/tests/ui/async_yields_async.stderr
@@ -1,5 +1,5 @@
 error: an async construct yields a type which is itself awaitable
-  --> $DIR/async_yields_async.rs:34:9
+  --> $DIR/async_yields_async.rs:40:9
    |
 LL |        let _h = async {
    |   ____________________-
@@ -20,7 +20,7 @@ LL |         }.await
    |
 
 error: an async construct yields a type which is itself awaitable
-  --> $DIR/async_yields_async.rs:39:9
+  --> $DIR/async_yields_async.rs:45:9
    |
 LL |       let _i = async {
    |  ____________________-
@@ -33,7 +33,7 @@ LL | |     };
    | |_____- outer async construct
 
 error: an async construct yields a type which is itself awaitable
-  --> $DIR/async_yields_async.rs:45:9
+  --> $DIR/async_yields_async.rs:51:9
    |
 LL |        let _j = async || {
    |   _______________________-
@@ -53,7 +53,7 @@ LL |         }.await
    |
 
 error: an async construct yields a type which is itself awaitable
-  --> $DIR/async_yields_async.rs:50:9
+  --> $DIR/async_yields_async.rs:56:9
    |
 LL |       let _k = async || {
    |  _______________________-
@@ -66,7 +66,7 @@ LL | |     };
    | |_____- outer async construct
 
 error: an async construct yields a type which is itself awaitable
-  --> $DIR/async_yields_async.rs:52:23
+  --> $DIR/async_yields_async.rs:58:23
    |
 LL |     let _l = async || CustomFutureType;
    |                       ^^^^^^^^^^^^^^^^
@@ -76,7 +76,7 @@ LL |     let _l = async || CustomFutureType;
    |                       help: consider awaiting this value: `CustomFutureType.await`
 
 error: an async construct yields a type which is itself awaitable
-  --> $DIR/async_yields_async.rs:58:9
+  --> $DIR/async_yields_async.rs:64:9
    |
 LL |       let _m = async || {
    |  _______________________-