about summary refs log tree commit diff
path: root/src/test/ui/async-await/issues
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-10-03 12:19:21 +0000
committerbors <bors@rust-lang.org>2019-10-03 12:19:21 +0000
commitcfb6d84720019236e33872e145d187dfd6e81090 (patch)
tree0832dd156d9ad55c93bee020fee1ea14c737a55e /src/test/ui/async-await/issues
parent0221e265621a5fcc68ca62bdcdeabad1882a0e9a (diff)
parenta807032f9e4e4b43db17a1f17be766bb02d23a57 (diff)
downloadrust-cfb6d84720019236e33872e145d187dfd6e81090.tar.gz
rust-cfb6d84720019236e33872e145d187dfd6e81090.zip
Auto merge of #64999 - nikomatsakis:issue-60424-async-return-inference, r=cramertj
extract expected return type for async fn generators

Fixes #60424

cc @Centril, I know you've been eager to see this fixed.

r? @cramertj
Diffstat (limited to 'src/test/ui/async-await/issues')
-rw-r--r--src/test/ui/async-await/issues/issue-63388-1.rs4
-rw-r--r--src/test/ui/async-await/issues/issue-63388-1.stderr9
-rw-r--r--src/test/ui/async-await/issues/issue-63388-2.stderr9
3 files changed, 12 insertions, 10 deletions
diff --git a/src/test/ui/async-await/issues/issue-63388-1.rs b/src/test/ui/async-await/issues/issue-63388-1.rs
index 3cde5de2198..baecf49c798 100644
--- a/src/test/ui/async-await/issues/issue-63388-1.rs
+++ b/src/test/ui/async-await/issues/issue-63388-1.rs
@@ -9,9 +9,9 @@ trait Foo {}
 impl Xyz {
     async fn do_sth<'a>(
         &'a self, foo: &dyn Foo
-    ) -> &dyn Foo //~ ERROR lifetime mismatch
+    ) -> &dyn Foo
     {
-        foo
+        foo  //~ ERROR lifetime mismatch
     }
 }
 
diff --git a/src/test/ui/async-await/issues/issue-63388-1.stderr b/src/test/ui/async-await/issues/issue-63388-1.stderr
index a54cadb0cd2..2917fa9ccb7 100644
--- a/src/test/ui/async-await/issues/issue-63388-1.stderr
+++ b/src/test/ui/async-await/issues/issue-63388-1.stderr
@@ -1,12 +1,13 @@
 error[E0623]: lifetime mismatch
-  --> $DIR/issue-63388-1.rs:12:10
+  --> $DIR/issue-63388-1.rs:14:9
    |
 LL |         &'a self, foo: &dyn Foo
    |         -------- this parameter and the return type are declared with different lifetimes...
 LL |     ) -> &dyn Foo
-   |          ^^^^^^^^
-   |          |
-   |          ...but data from `foo` is returned here
+   |          --------
+LL |     {
+LL |         foo
+   |         ^^^ ...but data from `foo` is returned here
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/async-await/issues/issue-63388-2.stderr b/src/test/ui/async-await/issues/issue-63388-2.stderr
index 1edeb3d5493..5099297fbeb 100644
--- a/src/test/ui/async-await/issues/issue-63388-2.stderr
+++ b/src/test/ui/async-await/issues/issue-63388-2.stderr
@@ -11,8 +11,9 @@ error: cannot infer an appropriate lifetime
    |
 LL |         foo: &dyn Foo, bar: &'a dyn Foo
    |         ^^^ ...but this borrow...
-LL |     ) -> &dyn Foo
-   |          -------- this return type evaluates to the `'static` lifetime...
+...
+LL |         foo
+   |         --- this return type evaluates to the `'static` lifetime...
    |
 note: ...can't outlive the lifetime '_ as defined on the method body at 11:14
   --> $DIR/issue-63388-2.rs:11:14
@@ -21,8 +22,8 @@ LL |         foo: &dyn Foo, bar: &'a dyn Foo
    |              ^
 help: you can add a constraint to the return type to make it last less than `'static` and match the lifetime '_ as defined on the method body at 11:14
    |
-LL |     ) -> &dyn Foo + '_
-   |          ^^^^^^^^^^^^^
+LL |         foo + '_
+   |
 
 error: aborting due to 2 previous errors