about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2019-08-12 21:13:59 -0400
committerNiko Matsakis <niko@alum.mit.edu>2019-08-12 21:13:59 -0400
commitd7c7c52dbc462048cb60d4dca43b42d753025a6b (patch)
tree41f4fc49a2f0c319adad1f492f4840296d9dc278 /src
parentad214fe47092c5b3d36a58480f6fa3f62d20770b (diff)
bless tests
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.rs10
-rw-r--r--src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.stderr85
-rw-r--r--src/test/ui/self/elision/ref-mut-self-async.stderr10
-rw-r--r--src/test/ui/self/elision/ref-self-async.stderr12
-rw-r--r--src/test/ui/self/self_lifetime-async.nll.stderr11
-rw-r--r--src/test/ui/self/self_lifetime-async.rs6
-rw-r--r--src/test/ui/self/self_lifetime-async.stderr39
7 files changed, 27 insertions, 146 deletions
diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.rs b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.rs
index 93870b7cdcf..53ab75ee16b 100644
--- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.rs
+++ b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.rs
@@ -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>;
diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.stderr b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.stderr
index c7d10e7fc78..74fc4741349 100644
--- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.stderr
+++ b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.stderr
@@ -1,81 +1,23 @@
-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 }
    |                                  -----                   ^^^
@@ -83,6 +25,5 @@ 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`.
diff --git a/src/test/ui/self/elision/ref-mut-self-async.stderr b/src/test/ui/self/elision/ref-mut-self-async.stderr
index d605bab4636..805833f9472 100644
--- a/src/test/ui/self/elision/ref-mut-self-async.stderr
+++ b/src/test/ui/self/elision/ref-mut-self-async.stderr
@@ -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 {
    |                             ---------              ^^^^
@@ -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 {
    |                                     ---------               ^^^^
@@ -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 {
    |                                     ---------               ^^^^
@@ -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 {
    |                                             ---------                ^^^^
@@ -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 {
    |                                             ---------                ^^^^
diff --git a/src/test/ui/self/elision/ref-self-async.stderr b/src/test/ui/self/elision/ref-self-async.stderr
index e169f3cf6f1..eb796a07a86 100644
--- a/src/test/ui/self/elision/ref-self-async.stderr
+++ b/src/test/ui/self/elision/ref-self-async.stderr
@@ -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 {
    |                             -----              ^^^^
@@ -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 {
    |                                     -----               ^^^^
@@ -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 {
    |                                     -----               ^^^^
@@ -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 {
    |                                             -----                ^^^^
@@ -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 {
    |                                             -----                ^^^^
@@ -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 {
    |                                            -----                    ^^^
diff --git a/src/test/ui/self/self_lifetime-async.nll.stderr b/src/test/ui/self/self_lifetime-async.nll.stderr
deleted file mode 100644
index 805d2433f87..00000000000
--- a/src/test/ui/self/self_lifetime-async.nll.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0106]: missing lifetime specifier
-  --> $DIR/self_lifetime-async.rs:9:44
-   |
-LL |     async fn foo<'b>(self: &'b Foo<'a>) -> &() { self.0 }
-   |                                            ^
-   |
-   = note: return-position elided lifetimes require exactly one input-position elided lifetime, found none.
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/self/self_lifetime-async.rs b/src/test/ui/self/self_lifetime-async.rs
index 71eba01fe1a..ec4c3d15224 100644
--- a/src/test/ui/self/self_lifetime-async.rs
+++ b/src/test/ui/self/self_lifetime-async.rs
@@ -1,5 +1,4 @@
-// FIXME: Investigate why `self_lifetime.rs` is check-pass but this isn't.
-
+// check-pass
 // edition:2018
 
 #![feature(async_await)]
@@ -7,14 +6,11 @@
 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() {}
diff --git a/src/test/ui/self/self_lifetime-async.stderr b/src/test/ui/self/self_lifetime-async.stderr
deleted file mode 100644
index e3ec1abd447..00000000000
--- a/src/test/ui/self/self_lifetime-async.stderr
+++ /dev/null
@@ -1,39 +0,0 @@
-error[E0106]: missing lifetime specifier
-  --> $DIR/self_lifetime-async.rs:9:44
-   |
-LL |     async fn foo<'b>(self: &'b Foo<'a>) -> &() { self.0 }
-   |                                            ^
-   |
-   = note: return-position elided lifetimes require exactly one input-position elided lifetime, found none.
-
-error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
-  --> $DIR/self_lifetime-async.rs:9:22
-   |
-LL |     async fn foo<'b>(self: &'b Foo<'a>) -> &() { self.0 }
-   |                      ^^^^
-   |
-note: first, the lifetime cannot outlive the lifetime 'a as defined on the impl at 8:6...
-  --> $DIR/self_lifetime-async.rs:8:6
-   |
-LL | impl<'a> Foo<'a> {
-   |      ^^
-   = note: ...so that the expression is assignable:
-           expected &Foo<'_>
-              found &'b Foo<'a>
-   = note: but, the lifetime must be valid for the static lifetime...
-   = note: ...so that the types are compatible:
-           expected &()
-              found &'static ()
-
-error[E0623]: lifetime mismatch
-  --> $DIR/self_lifetime-async.rs:16:52
-   |
-LL |     async fn bar<'a>(self: &Alias, 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 3 previous errors
-
-For more information about this error, try `rustc --explain E0106`.