Skip to content

Commit

Permalink
bless tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Aug 13, 2019
1 parent ad214fe commit d7c7c52
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 146 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,10 @@ struct Foo;

impl Foo {
async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
//~^ ERROR missing lifetime specifier
//~| ERROR cannot infer an appropriate lifetime
// FIXME: should be E0623?
//~^ ERROR lifetime mismatch

async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
//~^ ERROR missing lifetime specifier
//~| ERROR cannot infer an appropriate lifetime
//~| ERROR missing lifetime specifier
//~| ERROR cannot infer an appropriate lifetime
// FIXME: should be E0623?
//~^ ERROR lifetime mismatch
}

type Alias<T> = Pin<T>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,88 +1,29 @@
error[E0106]: missing lifetime specifier
error[E0623]: lifetime mismatch
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:10:45
|
LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
| ^
|
= note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple.

error[E0106]: missing lifetime specifier
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:60
|
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
| ^
|
= note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple.
| ---- ^^^^
| | |
| | ...but data from `f` is returned here
| this parameter and the return type are declared with different lifetimes...

error[E0106]: missing lifetime specifier
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:67
|
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
| ^
|
= note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple.

error: cannot infer an appropriate lifetime
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:10:33
|
LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
| ^ ---- this return type evaluates to the `'static` lifetime...
| |
| ...but this borrow...
|
note: ...can't outlive the lifetime '_ as defined on the method body at 10:26
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:10:26
|
LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
| ^
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 10:26
|
LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo + '_ { f }
| ^^^^^^^^^

error: cannot infer an appropriate lifetime
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:16
|
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
| ^^^^ ...but this borrow... ----------------- this return type evaluates to the `'static` lifetime...
|
note: ...can't outlive the lifetime '_ as defined on the method body at 15:26
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:26
|
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
| ^
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 15:26
|
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) + '_ { (self, f) }
| ^^^^^^^^^^^^^^^^^^^^^^

error: cannot infer an appropriate lifetime
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:34
|
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
| ^ ----------------- this return type evaluates to the `'static` lifetime...
| |
| ...but this borrow...
|
note: ...can't outlive the lifetime '_ as defined on the method body at 15:26
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:26
error[E0623]: lifetime mismatch
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:13:55
|
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
| ^
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 15:26
|
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) + '_ { (self, f) }
| ^^^^^^^^^^^^^^^^^^^^^^
| ----- ^^^^^^^^^^^^^^^^^
| | |
| | ...but data from `f` is returned here
| this parameter and the return type are declared with different lifetimes...

error[E0623]: lifetime mismatch
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:25:58
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:19:58
|
LL | async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
| ----- ^^^
| | |
| | ...but data from `arg` is returned here
| this parameter and the return type are declared with different lifetimes...

error: aborting due to 7 previous errors
error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0106`.
10 changes: 5 additions & 5 deletions src/test/ui/self/elision/ref-mut-self-async.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LL | async fn ref_self(&mut self, f: &u32) -> &u32 {
| this parameter and the return type are declared with different lifetimes...

error[E0623]: lifetime mismatch
--> $DIR/ref-mut-self-async.rs:24:52
--> $DIR/ref-mut-self-async.rs:21:52
|
LL | async fn ref_Self(self: &mut Self, f: &u32) -> &u32 {
| --------- ^^^^
Expand All @@ -17,7 +17,7 @@ LL | async fn ref_Self(self: &mut Self, f: &u32) -> &u32 {
| this parameter and the return type are declared with different lifetimes...

error[E0623]: lifetime mismatch
--> $DIR/ref-mut-self-async.rs:28:61
--> $DIR/ref-mut-self-async.rs:25:61
|
LL | async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 {
| --------- ^^^^
Expand All @@ -26,7 +26,7 @@ LL | async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 {
| this parameter and the return type are declared with different lifetimes...

error[E0623]: lifetime mismatch
--> $DIR/ref-mut-self-async.rs:32:61
--> $DIR/ref-mut-self-async.rs:29:61
|
LL | async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 {
| --------- ^^^^
Expand All @@ -35,7 +35,7 @@ LL | async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 {
| this parameter and the return type are declared with different lifetimes...

error[E0623]: lifetime mismatch
--> $DIR/ref-mut-self-async.rs:36:70
--> $DIR/ref-mut-self-async.rs:33:70
|
LL | async fn box_box_ref_Self(self: Box<Box<&mut Self>>, f: &u32) -> &u32 {
| --------- ^^^^
Expand All @@ -44,7 +44,7 @@ LL | async fn box_box_ref_Self(self: Box<Box<&mut Self>>, f: &u32) -> &u32 {
| this parameter and the return type are declared with different lifetimes...

error[E0623]: lifetime mismatch
--> $DIR/ref-mut-self-async.rs:40:70
--> $DIR/ref-mut-self-async.rs:37:70
|
LL | async fn box_pin_ref_Self(self: Box<Pin<&mut Self>>, f: &u32) -> &u32 {
| --------- ^^^^
Expand Down
12 changes: 6 additions & 6 deletions src/test/ui/self/elision/ref-self-async.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LL | async fn ref_self(&self, f: &u32) -> &u32 {
| this parameter and the return type are declared with different lifetimes...

error[E0623]: lifetime mismatch
--> $DIR/ref-self-async.rs:33:48
--> $DIR/ref-self-async.rs:30:48
|
LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 {
| ----- ^^^^
Expand All @@ -17,7 +17,7 @@ LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 {
| this parameter and the return type are declared with different lifetimes...

error[E0623]: lifetime mismatch
--> $DIR/ref-self-async.rs:37:57
--> $DIR/ref-self-async.rs:34:57
|
LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
| ----- ^^^^
Expand All @@ -26,7 +26,7 @@ LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
| this parameter and the return type are declared with different lifetimes...

error[E0623]: lifetime mismatch
--> $DIR/ref-self-async.rs:41:57
--> $DIR/ref-self-async.rs:38:57
|
LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
| ----- ^^^^
Expand All @@ -35,7 +35,7 @@ LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
| this parameter and the return type are declared with different lifetimes...

error[E0623]: lifetime mismatch
--> $DIR/ref-self-async.rs:45:66
--> $DIR/ref-self-async.rs:42:66
|
LL | async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
| ----- ^^^^
Expand All @@ -44,7 +44,7 @@ LL | async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
| this parameter and the return type are declared with different lifetimes...

error[E0623]: lifetime mismatch
--> $DIR/ref-self-async.rs:49:66
--> $DIR/ref-self-async.rs:46:66
|
LL | async fn box_pin_ref_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
| ----- ^^^^
Expand All @@ -53,7 +53,7 @@ LL | async fn box_pin_ref_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
| this parameter and the return type are declared with different lifetimes...

error[E0623]: lifetime mismatch
--> $DIR/ref-self-async.rs:53:69
--> $DIR/ref-self-async.rs:50:69
|
LL | async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 {
| ----- ^^^
Expand Down
11 changes: 0 additions & 11 deletions src/test/ui/self/self_lifetime-async.nll.stderr

This file was deleted.

6 changes: 1 addition & 5 deletions src/test/ui/self/self_lifetime-async.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
// FIXME: Investigate why `self_lifetime.rs` is check-pass but this isn't.

// check-pass
// edition:2018

#![feature(async_await)]

struct Foo<'a>(&'a ());
impl<'a> Foo<'a> {
async fn foo<'b>(self: &'b Foo<'a>) -> &() { self.0 }
//~^ ERROR missing lifetime specifier
//~| ERROR cannot infer an appropriate lifetime
}

type Alias = Foo<'static>;
impl Alias {
async fn bar<'a>(self: &Alias, arg: &'a ()) -> &() { arg }
//~^ ERROR lifetime mismatch
}

fn main() {}
39 changes: 0 additions & 39 deletions src/test/ui/self/self_lifetime-async.stderr

This file was deleted.

0 comments on commit d7c7c52

Please sign in to comment.