]> git.lizzy.rs Git - rust.git/commitdiff
bless tests
authorNiko Matsakis <niko@alum.mit.edu>
Tue, 13 Aug 2019 01:13:59 +0000 (21:13 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Tue, 13 Aug 2019 01:13:59 +0000 (21:13 -0400)
src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.rs
src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.stderr
src/test/ui/self/elision/ref-mut-self-async.stderr
src/test/ui/self/elision/ref-self-async.stderr
src/test/ui/self/self_lifetime-async.nll.stderr [deleted file]
src/test/ui/self/self_lifetime-async.rs
src/test/ui/self/self_lifetime-async.stderr [deleted file]

index 93870b7cdcf288261a85528a28fa38013fe15234..53ab75ee16bd0d1803f322ec7a55f6f5e63718c6 100644 (file)
@@ -8,16 +8,10 @@
 
 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>;
index c7d10e7fc780d4cded6a5e9865a61bf6b592bc4e..74fc4741349492fb92bbfa5644e7574520eceb9a 100644 (file)
@@ -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`.
index d605bab463697e213c336ed43ef677f6e6f7ce72..805833f94720dfdc5fb21838749a1179e1b829e3 100644 (file)
@@ -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 {
    |                                             ---------                ^^^^
index e169f3cf6f1f70823469c1e37fa1b5f64908164b..eb796a07a86d57f45b3f9a6947fe39021e37e3f8 100644 (file)
@@ -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 (file)
index 805d243..0000000
+++ /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`.
index 71eba01fe1a02bf76d18ef3298509bb7c96904b0..ec4c3d15224232548e3f40a84304f5d5a473e7c6 100644 (file)
@@ -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 (file)
index e3ec1ab..0000000
+++ /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`.