]> git.lizzy.rs Git - rust.git/commitdiff
Update tests
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Thu, 6 Feb 2020 09:33:05 +0000 (10:33 +0100)
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Mon, 23 Mar 2020 18:31:41 +0000 (19:31 +0100)
17 files changed:
src/test/ui/async-await/async-block-control-flow-static-semantics.stderr
src/test/ui/async-await/async-error-span.rs
src/test/ui/async-await/async-error-span.stderr
src/test/ui/async-await/await-keyword/incorrect-syntax-suggestions.rs
src/test/ui/async-await/await-keyword/incorrect-syntax-suggestions.stderr
src/test/ui/async-await/issue-67651.rs [new file with mode: 0644]
src/test/ui/async-await/issue-67651.stderr [new file with mode: 0644]
src/test/ui/async-await/issues/issue-63388-2.nll.stderr [deleted file]
src/test/ui/async-await/issues/issue-63388-2.rs
src/test/ui/async-await/issues/issue-63388-2.stderr
src/test/ui/async-await/issues/issue-65159.rs
src/test/ui/async-await/issues/issue-65159.stderr
src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-no-fg.rs
src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-no-fg.stderr
src/test/ui/self/elision/ref-self-async.nll.stderr
src/test/ui/self/elision/ref-self-async.rs
src/test/ui/self/elision/ref-self-async.stderr

index afb8f146192ccddb69fcef8581251911e757c72a..46a132da309bba541da8a8d8056311de7e0128b0 100644 (file)
@@ -18,22 +18,6 @@ LL | |             break 0u8;
 LL | |         };
    | |_________- enclosing `async` block
 
-error[E0308]: mismatched types
-  --> $DIR/async-block-control-flow-static-semantics.rs:13:43
-   |
-LL | fn return_targets_async_block_not_fn() -> u8 {
-   |    ---------------------------------      ^^ expected `u8`, found `()`
-   |    |
-   |    implicitly returns `()` as its body has no tail or `return` expression
-
-error[E0271]: type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == ()`
-  --> $DIR/async-block-control-flow-static-semantics.rs:18:39
-   |
-LL |     let _: &dyn Future<Output = ()> = &block;
-   |                                       ^^^^^^ expected `()`, found `u8`
-   |
-   = note: required for the cast to the object type `dyn std::future::Future<Output = ()>`
-
 error[E0308]: mismatched types
   --> $DIR/async-block-control-flow-static-semantics.rs:22:58
    |
@@ -55,6 +39,22 @@ LL |     let _: &dyn Future<Output = ()> = &block;
    |
    = note: required for the cast to the object type `dyn std::future::Future<Output = ()>`
 
+error[E0308]: mismatched types
+  --> $DIR/async-block-control-flow-static-semantics.rs:13:43
+   |
+LL | fn return_targets_async_block_not_fn() -> u8 {
+   |    ---------------------------------      ^^ expected `u8`, found `()`
+   |    |
+   |    implicitly returns `()` as its body has no tail or `return` expression
+
+error[E0271]: type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == ()`
+  --> $DIR/async-block-control-flow-static-semantics.rs:18:39
+   |
+LL |     let _: &dyn Future<Output = ()> = &block;
+   |                                       ^^^^^^ expected `()`, found `u8`
+   |
+   = note: required for the cast to the object type `dyn std::future::Future<Output = ()>`
+
 error[E0308]: mismatched types
   --> $DIR/async-block-control-flow-static-semantics.rs:48:44
    |
index 28132c9789c67ad922ecb7ba28caa5e50cab6569..cf10ebfeca9399cc7db1dc9b95362339f9f2849f 100644 (file)
@@ -5,6 +5,7 @@
 use std::future::Future;
 
 fn get_future() -> impl Future<Output = ()> {
+//~^ ERROR the trait bound `(): std::future::Future` is not satisfied
     panic!()
 }
 
index b551b99587dd939d15c1a162e4073d71d14ba1d2..4054e739c483d58e0dce7cedd73aa7e913271fa7 100644 (file)
@@ -1,15 +1,27 @@
+error[E0277]: the trait bound `(): std::future::Future` is not satisfied
+  --> $DIR/async-error-span.rs:7:20
+   |
+LL | fn get_future() -> impl Future<Output = ()> {
+   |                    ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `()`
+LL |
+LL |     panic!()
+   |     -------- this returned value is of type `!`
+   |
+   = note: the return type of a function must have a statically known size
+
 error[E0698]: type inside `async fn` body must be known in this context
-  --> $DIR/async-error-span.rs:12:9
+  --> $DIR/async-error-span.rs:13:9
    |
 LL |     let a;
    |         ^ cannot infer type
    |
 note: the type is part of the `async fn` body because of this `await`
-  --> $DIR/async-error-span.rs:13:5
+  --> $DIR/async-error-span.rs:14:5
    |
 LL |     get_future().await;
    |     ^^^^^^^^^^^^^^^^^^
 
-error: aborting due to previous error
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0698`.
+Some errors have detailed explanations: E0277, E0698.
+For more information about an error, try `rustc --explain E0277`.
index 22bcbb1064dd744266b16cd3db205f5bac75debc..cebff3be6b059299f47d7548fa38b0d56fb1c771 100644 (file)
@@ -62,6 +62,7 @@ fn foo10() -> Result<(), ()> {
 fn foo11() -> Result<(), ()> {
     let _ = await bar()?; //~ ERROR `await` is only allowed inside `async` functions and blocks
     //~^ ERROR incorrect use of `await`
+    //~| ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
     Ok(())
 }
 fn foo12() -> Result<(), ()> {
index 92cef80c19360d27c6b0ebd71fad26730fe750cc..61f2570b2ff934a42fbd2982988ce545ebada08b 100644 (file)
@@ -71,49 +71,49 @@ LL |     let _ = await bar()?;
    |             ^^^^^^^^^^^^ help: `await` is a postfix operation: `bar()?.await`
 
 error: incorrect use of `await`
-  --> $DIR/incorrect-syntax-suggestions.rs:68:14
+  --> $DIR/incorrect-syntax-suggestions.rs:69:14
    |
 LL |     let _ = (await bar())?;
    |              ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
 
 error: incorrect use of `await`
-  --> $DIR/incorrect-syntax-suggestions.rs:73:24
+  --> $DIR/incorrect-syntax-suggestions.rs:74:24
    |
 LL |     let _ = bar().await();
    |                        ^^ help: `await` is not a method call, remove the parentheses
 
 error: incorrect use of `await`
-  --> $DIR/incorrect-syntax-suggestions.rs:78:24
+  --> $DIR/incorrect-syntax-suggestions.rs:79:24
    |
 LL |     let _ = bar().await()?;
    |                        ^^ help: `await` is not a method call, remove the parentheses
 
 error: incorrect use of `await`
-  --> $DIR/incorrect-syntax-suggestions.rs:106:13
+  --> $DIR/incorrect-syntax-suggestions.rs:107:13
    |
 LL |     let _ = await!(bar());
    |             ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
 
 error: incorrect use of `await`
-  --> $DIR/incorrect-syntax-suggestions.rs:110:13
+  --> $DIR/incorrect-syntax-suggestions.rs:111:13
    |
 LL |     let _ = await!(bar())?;
    |             ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
 
 error: incorrect use of `await`
-  --> $DIR/incorrect-syntax-suggestions.rs:115:17
+  --> $DIR/incorrect-syntax-suggestions.rs:116:17
    |
 LL |         let _ = await!(bar())?;
    |                 ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
 
 error: incorrect use of `await`
-  --> $DIR/incorrect-syntax-suggestions.rs:123:17
+  --> $DIR/incorrect-syntax-suggestions.rs:124:17
    |
 LL |         let _ = await!(bar())?;
    |                 ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
 
 error: expected expression, found `=>`
-  --> $DIR/incorrect-syntax-suggestions.rs:131:25
+  --> $DIR/incorrect-syntax-suggestions.rs:132:25
    |
 LL |     match await { await => () }
    |                   ----- ^^ expected expression
@@ -121,13 +121,13 @@ LL |     match await { await => () }
    |                   while parsing this incorrect await expression
 
 error: incorrect use of `await`
-  --> $DIR/incorrect-syntax-suggestions.rs:131:11
+  --> $DIR/incorrect-syntax-suggestions.rs:132:11
    |
 LL |     match await { await => () }
    |           ^^^^^^^^^^^^^^^^^^^^^ help: `await` is a postfix operation: `{ await => () }.await`
 
 error: expected one of `.`, `?`, `{`, or an operator, found `}`
-  --> $DIR/incorrect-syntax-suggestions.rs:134:1
+  --> $DIR/incorrect-syntax-suggestions.rs:135:1
    |
 LL |     match await { await => () }
    |     -----                      - expected one of `.`, `?`, `{`, or an operator
@@ -162,7 +162,7 @@ LL |     let _ = await bar()?;
    |             ^^^^^^^^^^^^ only allowed inside `async` functions and blocks
 
 error[E0728]: `await` is only allowed inside `async` functions and blocks
-  --> $DIR/incorrect-syntax-suggestions.rs:68:14
+  --> $DIR/incorrect-syntax-suggestions.rs:69:14
    |
 LL | fn foo12() -> Result<(), ()> {
    |    ----- this is not `async`
@@ -170,7 +170,7 @@ LL |     let _ = (await bar())?;
    |              ^^^^^^^^^^^ only allowed inside `async` functions and blocks
 
 error[E0728]: `await` is only allowed inside `async` functions and blocks
-  --> $DIR/incorrect-syntax-suggestions.rs:73:13
+  --> $DIR/incorrect-syntax-suggestions.rs:74:13
    |
 LL | fn foo13() -> Result<(), ()> {
    |    ----- this is not `async`
@@ -178,7 +178,7 @@ LL |     let _ = bar().await();
    |             ^^^^^^^^^^^ only allowed inside `async` functions and blocks
 
 error[E0728]: `await` is only allowed inside `async` functions and blocks
-  --> $DIR/incorrect-syntax-suggestions.rs:78:13
+  --> $DIR/incorrect-syntax-suggestions.rs:79:13
    |
 LL | fn foo14() -> Result<(), ()> {
    |    ----- this is not `async`
@@ -186,7 +186,7 @@ LL |     let _ = bar().await()?;
    |             ^^^^^^^^^^^ only allowed inside `async` functions and blocks
 
 error[E0728]: `await` is only allowed inside `async` functions and blocks
-  --> $DIR/incorrect-syntax-suggestions.rs:83:13
+  --> $DIR/incorrect-syntax-suggestions.rs:84:13
    |
 LL | fn foo15() -> Result<(), ()> {
    |    ----- this is not `async`
@@ -194,7 +194,7 @@ LL |     let _ = bar().await;
    |             ^^^^^^^^^^^ only allowed inside `async` functions and blocks
 
 error[E0728]: `await` is only allowed inside `async` functions and blocks
-  --> $DIR/incorrect-syntax-suggestions.rs:87:13
+  --> $DIR/incorrect-syntax-suggestions.rs:88:13
    |
 LL | fn foo16() -> Result<(), ()> {
    |    ----- this is not `async`
@@ -202,7 +202,7 @@ LL |     let _ = bar().await?;
    |             ^^^^^^^^^^^ only allowed inside `async` functions and blocks
 
 error[E0728]: `await` is only allowed inside `async` functions and blocks
-  --> $DIR/incorrect-syntax-suggestions.rs:92:17
+  --> $DIR/incorrect-syntax-suggestions.rs:93:17
    |
 LL |     fn foo() -> Result<(), ()> {
    |        --- this is not `async`
@@ -210,7 +210,7 @@ LL |         let _ = bar().await?;
    |                 ^^^^^^^^^^^ only allowed inside `async` functions and blocks
 
 error[E0728]: `await` is only allowed inside `async` functions and blocks
-  --> $DIR/incorrect-syntax-suggestions.rs:99:17
+  --> $DIR/incorrect-syntax-suggestions.rs:100:17
    |
 LL |     let foo = || {
    |               -- this is not `async`
@@ -218,7 +218,7 @@ LL |         let _ = bar().await?;
    |                 ^^^^^^^^^^^ only allowed inside `async` functions and blocks
 
 error[E0728]: `await` is only allowed inside `async` functions and blocks
-  --> $DIR/incorrect-syntax-suggestions.rs:115:17
+  --> $DIR/incorrect-syntax-suggestions.rs:116:17
    |
 LL |     fn foo() -> Result<(), ()> {
    |        --- this is not `async`
@@ -226,7 +226,7 @@ LL |         let _ = await!(bar())?;
    |                 ^^^^^^^^^^^^^ only allowed inside `async` functions and blocks
 
 error[E0728]: `await` is only allowed inside `async` functions and blocks
-  --> $DIR/incorrect-syntax-suggestions.rs:123:17
+  --> $DIR/incorrect-syntax-suggestions.rs:124:17
    |
 LL |     let foo = || {
    |               -- this is not `async`
@@ -242,7 +242,16 @@ LL |     let _ = await bar()?;
    = help: the trait `std::ops::Try` is not implemented for `impl std::future::Future`
    = note: required by `std::ops::Try::into_result`
 
-error: aborting due to 35 previous errors
+error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
+  --> $DIR/incorrect-syntax-suggestions.rs:63:19
+   |
+LL |     let _ = await bar()?;
+   |                   ^^^^^^ the `?` operator cannot be applied to type `impl std::future::Future`
+   |
+   = help: the trait `std::ops::Try` is not implemented for `impl std::future::Future`
+   = note: required by `std::ops::Try::into_result`
+
+error: aborting due to 36 previous errors
 
 Some errors have detailed explanations: E0277, E0728.
 For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/async-await/issue-67651.rs b/src/test/ui/async-await/issue-67651.rs
new file mode 100644 (file)
index 0000000..bd96a3b
--- /dev/null
@@ -0,0 +1,20 @@
+// edition:2018
+
+trait From {
+    fn from();
+}
+
+impl From for () {
+    fn from() {}
+}
+
+impl From for () {
+//~^ ERROR conflicting implementations of trait
+    fn from() {}
+}
+
+fn bar() -> impl core::future::Future<Output = ()> {
+    async move { From::from() }
+}
+
+fn main() {}
diff --git a/src/test/ui/async-await/issue-67651.stderr b/src/test/ui/async-await/issue-67651.stderr
new file mode 100644 (file)
index 0000000..99857c2
--- /dev/null
@@ -0,0 +1,12 @@
+error[E0119]: conflicting implementations of trait `From` for type `()`:
+  --> $DIR/issue-67651.rs:11:1
+   |
+LL | impl From for () {
+   | ---------------- first implementation here
+...
+LL | impl From for () {
+   | ^^^^^^^^^^^^^^^^ conflicting implementation for `()`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/async-await/issues/issue-63388-2.nll.stderr b/src/test/ui/async-await/issues/issue-63388-2.nll.stderr
deleted file mode 100644 (file)
index 6edb9e6..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-error[E0106]: missing lifetime specifier
-  --> $DIR/issue-63388-2.rs:12:10
-   |
-LL |         foo: &dyn Foo, bar: &'a dyn Foo
-   |              --------       -----------
-LL |     ) -> &dyn Foo
-   |          ^ help: consider using the named lifetime: `&'a`
-   |
-   = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `foo` or `bar`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0106`.
index 73e7f25f97d0d82140a13bae39c93f3717587ccd..458bc9faeaf272bfb2d879edd699b31bcf054718 100644 (file)
@@ -8,7 +8,7 @@ trait Foo {}
 
 impl Xyz {
     async fn do_sth<'a>(
-        foo: &dyn Foo, bar: &'a dyn Foo //~ ERROR cannot infer
+        foo: &dyn Foo, bar: &'a dyn Foo
     ) -> &dyn Foo //~ ERROR missing lifetime specifier
     {
         foo
index 9f51ced9c3f499cb73ab02e5cece2ebca63ea4f0..6edb9e63d480a6ebc45f38b122b87885793e659b 100644 (file)
@@ -8,21 +8,6 @@ LL |     ) -> &dyn Foo
    |
    = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `foo` or `bar`
 
-error: cannot infer an appropriate lifetime
-  --> $DIR/issue-63388-2.rs:11:9
-   |
-LL |         foo: &dyn Foo, bar: &'a dyn Foo
-   |         ^^^ ...but this borrow...
-...
-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
-   |
-LL |         foo: &dyn Foo, bar: &'a dyn Foo
-   |              ^
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
 For more information about this error, try `rustc --explain E0106`.
index b5fee061f277e8a09316c359eaf0ac9a112ff740..2f80435046bdf5d2434000338251e27ed47d52ca 100644 (file)
@@ -5,6 +5,7 @@
 async fn copy() -> Result<()> //~ ERROR wrong number of type arguments
 {
     Ok(())
+    //~^ type annotations needed
 }
 
 fn main() { }
index 56d2c38b302e9319d2f3175d8095e697d42bc002..04cfa5249982e144659df44ee10a52fcfb025de8 100644 (file)
@@ -4,6 +4,13 @@ error[E0107]: wrong number of type arguments: expected 2, found 1
 LL | async fn copy() -> Result<()>
    |                    ^^^^^^^^^^ expected 2 type arguments
 
-error: aborting due to previous error
+error[E0282]: type annotations needed
+  --> $DIR/issue-65159.rs:7:5
+   |
+LL |     Ok(())
+   |     ^^ cannot infer type for type parameter `E` declared on the enum `Result`
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0107`.
+Some errors have detailed explanations: E0107, E0282.
+For more information about an error, try `rustc --explain E0107`.
index b12d7bccecead8c2f13b6f212ceeaf03773a433e..05960c0c7f6364f472a245023e9cead0afddc0e2 100644 (file)
@@ -9,6 +9,9 @@ impl<T> Trait<'_, '_> for T { }
 async fn async_ret_impl_trait<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
     //~^ ERROR ambiguous lifetime bound
     //~| ERROR ambiguous lifetime bound
+    //~| ERROR ambiguous lifetime bound
+    //~| ERROR hidden type for `impl Trait` captures lifetime that does not appear in bounds
+    //~| ERROR hidden type for `impl Trait` captures lifetime that does not appear in bounds
     (a, b)
 }
 
index f9a1b4b3394c107f0759c8aca9a96f7f5a70fd12..c69595a3f4d01dfae6601b378d0a525a0f09e9e6 100644 (file)
@@ -14,5 +14,42 @@ LL | async fn async_ret_impl_trait<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'
    |
    = help: add #![feature(member_constraints)] to the crate attributes to enable
 
-error: aborting due to 2 previous errors
+error: ambiguous lifetime bound in `impl Trait`
+  --> $DIR/ret-impl-trait-no-fg.rs:9:64
+   |
+LL | async fn async_ret_impl_trait<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
+   |                                                                ^^^^^^^^^^^^^^^^^^ the elided lifetimes here do not outlive one another
+   |
+   = help: add #![feature(member_constraints)] to the crate attributes to enable
+
+error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
+  --> $DIR/ret-impl-trait-no-fg.rs:9:1
+   |
+LL | / async fn async_ret_impl_trait<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
+LL | |
+LL | |
+LL | |
+...  |
+LL | |     (a, b)
+LL | | }
+   | |_^
+   |
+   = note: hidden type `(&u8, &u8)` captures lifetime '_#4r
+
+error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
+  --> $DIR/ret-impl-trait-no-fg.rs:9:1
+   |
+LL | / async fn async_ret_impl_trait<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
+LL | |
+LL | |
+LL | |
+...  |
+LL | |     (a, b)
+LL | | }
+   | |_^
+   |
+   = note: hidden type `(&u8, &u8)` captures lifetime '_#5r
+
+error: aborting due to 5 previous errors
 
+For more information about this error, try `rustc --explain E0700`.
index 541e49543221e41a17cb7845cf0a892ce10817f8..bd1f80811b5425748ffe18cf90ff1e3c70f5136a 100644 (file)
@@ -1,13 +1,72 @@
-error[E0658]: `Wrap<&Struct, Struct>` cannot be used as the type of `self` without the `arbitrary_self_types` feature
-  --> $DIR/ref-self-async.rs:47:39
+error: lifetime may not live long enough
+  --> $DIR/ref-self-async.rs:23:9
    |
-LL |     async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 {
-   |                                       ^^^^^^^^^^^^^^^^^
+LL |     async fn ref_self(&self, f: &u32) -> &u32 {
+   |                       -         - let's call the lifetime of this reference `'1`
+   |                       |
+   |                       let's call the lifetime of this reference `'2`
+LL |         f
+   |         ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
+
+error: lifetime may not live long enough
+  --> $DIR/ref-self-async.rs:29:9
+   |
+LL |     async fn ref_Self(self: &Self, f: &u32) -> &u32 {
+   |                             -         - let's call the lifetime of this reference `'1`
+   |                             |
+   |                             let's call the lifetime of this reference `'2`
+LL |         f
+   |         ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
+
+error: lifetime may not live long enough
+  --> $DIR/ref-self-async.rs:33:9
    |
-   = note: see issue #44874 <https://github.com/rust-lang/rust/issues/44874> for more information
-   = help: add `#![feature(arbitrary_self_types)]` to the crate attributes to enable
-   = help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
+LL |     async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
+   |                                     -          - let's call the lifetime of this reference `'1`
+   |                                     |
+   |                                     let's call the lifetime of this reference `'2`
+LL |         f
+   |         ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
+
+error: lifetime may not live long enough
+  --> $DIR/ref-self-async.rs:37:9
+   |
+LL |     async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
+   |                                     -          - let's call the lifetime of this reference `'1`
+   |                                     |
+   |                                     let's call the lifetime of this reference `'2`
+LL |         f
+   |         ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
+
+error: lifetime may not live long enough
+  --> $DIR/ref-self-async.rs:41:9
+   |
+LL |     async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
+   |                                             -           - let's call the lifetime of this reference `'1`
+   |                                             |
+   |                                             let's call the lifetime of this reference `'2`
+LL |         f
+   |         ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
+
+error: lifetime may not live long enough
+  --> $DIR/ref-self-async.rs:45:9
+   |
+LL |     async fn box_pin_ref_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
+   |                                             -           - let's call the lifetime of this reference `'1`
+   |                                             |
+   |                                             let's call the lifetime of this reference `'2`
+LL |         f
+   |         ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
+
+error: lifetime may not live long enough
+  --> $DIR/ref-self-async.rs:49:9
+   |
+LL |     async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 {
+   |                                            -                - let's call the lifetime of this reference `'1`
+   |                                            |
+   |                                            let's call the lifetime of this reference `'2`
+LL |         f
+   |         ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
 
-error: aborting due to previous error
+error: aborting due to 7 previous errors
 
-For more information about this error, try `rustc --explain E0658`.
index 6a98b79cb3bbafeb08097042597104c997492fa2..0fbbd95c975d6afb2ea35b35033a5480eabeba99 100644 (file)
@@ -1,6 +1,7 @@
 // edition:2018
 
 #![allow(non_snake_case)]
+#![feature(arbitrary_self_types)]
 
 use std::marker::PhantomData;
 use std::ops::Deref;
index b73290b024f8f285f762e624de7f473cb533ed59..bda958241b67b6564df1b8d6e7b8ee6a02ab8c04 100644 (file)
@@ -1,5 +1,5 @@
 error[E0623]: lifetime mismatch
-  --> $DIR/ref-self-async.rs:22:9
+  --> $DIR/ref-self-async.rs:23:9
    |
 LL |     async fn ref_self(&self, f: &u32) -> &u32 {
    |                       -----              ----
@@ -9,7 +9,7 @@ LL |         f
    |         ^ ...but data from `f` is returned here
 
 error[E0623]: lifetime mismatch
-  --> $DIR/ref-self-async.rs:28:9
+  --> $DIR/ref-self-async.rs:29:9
    |
 LL |     async fn ref_Self(self: &Self, f: &u32) -> &u32 {
    |                             -----              ----
@@ -19,7 +19,7 @@ LL |         f
    |         ^ ...but data from `f` is returned here
 
 error[E0623]: lifetime mismatch
-  --> $DIR/ref-self-async.rs:32:9
+  --> $DIR/ref-self-async.rs:33:9
    |
 LL |     async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
    |                                     -----               ----
@@ -29,7 +29,7 @@ LL |         f
    |         ^ ...but data from `f` is returned here
 
 error[E0623]: lifetime mismatch
-  --> $DIR/ref-self-async.rs:36:9
+  --> $DIR/ref-self-async.rs:37:9
    |
 LL |     async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
    |                                     -----               ----
@@ -39,7 +39,7 @@ LL |         f
    |         ^ ...but data from `f` is returned here
 
 error[E0623]: lifetime mismatch
-  --> $DIR/ref-self-async.rs:40:9
+  --> $DIR/ref-self-async.rs:41:9
    |
 LL |     async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
    |                                             -----                ----
@@ -49,7 +49,7 @@ LL |         f
    |         ^ ...but data from `f` is returned here
 
 error[E0623]: lifetime mismatch
-  --> $DIR/ref-self-async.rs:44:9
+  --> $DIR/ref-self-async.rs:45:9
    |
 LL |     async fn box_pin_ref_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
    |                                             -----                ----
@@ -59,7 +59,7 @@ LL |         f
    |         ^ ...but data from `f` is returned here
 
 error[E0623]: lifetime mismatch
-  --> $DIR/ref-self-async.rs:48:9
+  --> $DIR/ref-self-async.rs:49:9
    |
 LL |     async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 {
    |                                            -----                    ---