From 18d69c8ebe7b313d574014e6585680f78bd2e157 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 13 Aug 2019 09:13:50 -0400 Subject: [PATCH] bless tests with compare-mode=nll --- .../issues/issue-63388-1.nll.stderr | 24 +++ .../issues/issue-63388-2.nll.stderr | 11 ++ ...pes_pin_lifetime_mismatch-async.nll.stderr | 49 ++++-- .../self/elision/lt-ref-self-async.nll.stderr | 122 ++++++++++++--- .../elision/ref-mut-self-async.nll.stderr | 122 ++++++++++++--- .../elision/ref-mut-struct-async.nll.stderr | 102 ++++++++++--- .../ui/self/elision/ref-self-async.nll.stderr | 142 ++++++++++++++---- .../self/elision/ref-struct-async.nll.stderr | 102 ++++++++++--- 8 files changed, 538 insertions(+), 136 deletions(-) create mode 100644 src/test/ui/async-await/issues/issue-63388-1.nll.stderr create mode 100644 src/test/ui/async-await/issues/issue-63388-2.nll.stderr diff --git a/src/test/ui/async-await/issues/issue-63388-1.nll.stderr b/src/test/ui/async-await/issues/issue-63388-1.nll.stderr new file mode 100644 index 000000000000..fab5892dae18 --- /dev/null +++ b/src/test/ui/async-await/issues/issue-63388-1.nll.stderr @@ -0,0 +1,24 @@ +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/issue-63388-1.rs:14:10 + | +LL | ) -> &dyn Foo + | ^^^^^^^^ + | + = note: hidden type `impl std::future::Future` captures lifetime '_#27r + +error: lifetime may not live long enough + --> $DIR/issue-63388-1.rs:15:5 + | +LL | async fn do_sth<'a>( + | -- lifetime `'a` defined here +LL | &'a self, foo: &dyn Foo + | - lifetime `'_` defined here +LL | ) -> &dyn Foo +LL | / { +LL | | foo +LL | | } + | |_____^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'_` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0700`. 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 new file mode 100644 index 000000000000..b91cdc1b770f --- /dev/null +++ b/src/test/ui/async-await/issues/issue-63388-2.nll.stderr @@ -0,0 +1,11 @@ +error[E0106]: missing lifetime specifier + --> $DIR/issue-63388-2.rs:14:10 + | +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`. diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.nll.stderr b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.nll.stderr index 658560955567..94646c2cfe0c 100644 --- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.nll.stderr +++ b/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.nll.stderr @@ -1,27 +1,46 @@ -error[E0106]: missing lifetime specifier +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds --> $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. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:60 +error: lifetime may not live long enough + --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:10:50 + | +LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f } + | - ^^^^^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + | | + | lifetime `'_` defined here + | lifetime `'_` defined here + +error: lifetime may not live long enough + --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:13:73 | 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. + | - ^^^^^^^^^^^^^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + | | + | lifetime `'_` defined here + | lifetime `'_` defined here -error[E0106]: missing lifetime specifier - --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:67 +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:19:58 | -LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) } - | ^ +LL | async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg } + | ^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error: aborting due to 3 previous errors +error: lifetime may not live long enough + --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:19:62 + | +LL | async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg } + | -- - ^^^^^^^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'a` + | | | + | | lifetime `'_` defined here + | lifetime `'a` defined here -For more information about this error, try `rustc --explain E0106`. +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0700`. diff --git a/src/test/ui/self/elision/lt-ref-self-async.nll.stderr b/src/test/ui/self/elision/lt-ref-self-async.nll.stderr index d3aeb73b9b7c..779b21e21a09 100644 --- a/src/test/ui/self/elision/lt-ref-self-async.nll.stderr +++ b/src/test/ui/self/elision/lt-ref-self-async.nll.stderr @@ -1,51 +1,123 @@ -error[E0106]: missing lifetime specifier +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds --> $DIR/lt-ref-self-async.rs:15:42 | LL | async fn ref_self(&self, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#28r -error[E0106]: missing lifetime specifier - --> $DIR/lt-ref-self-async.rs:23:48 +error: lifetime may not live long enough + --> $DIR/lt-ref-self-async.rs:15:47 + | +LL | async fn ref_self(&self, f: &u32) -> &u32 { + | _______________________-_______________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/lt-ref-self-async.rs:21:48 | LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#28r -error[E0106]: missing lifetime specifier - --> $DIR/lt-ref-self-async.rs:29:57 +error: lifetime may not live long enough + --> $DIR/lt-ref-self-async.rs:21:53 + | +LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 { + | _____________________________-_______________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/lt-ref-self-async.rs:25:57 | LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#28r -error[E0106]: missing lifetime specifier - --> $DIR/lt-ref-self-async.rs:35:57 +error: lifetime may not live long enough + --> $DIR/lt-ref-self-async.rs:25:62 + | +LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { + | _____________________________________-________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/lt-ref-self-async.rs:29:57 | LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#28r -error[E0106]: missing lifetime specifier - --> $DIR/lt-ref-self-async.rs:41:66 +error: lifetime may not live long enough + --> $DIR/lt-ref-self-async.rs:29:62 + | +LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { + | _____________________________________-________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/lt-ref-self-async.rs:33:66 | LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#28r -error[E0106]: missing lifetime specifier - --> $DIR/lt-ref-self-async.rs:47:62 +error: lifetime may not live long enough + --> $DIR/lt-ref-self-async.rs:33:71 + | +LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { + | _____________________________________________-_________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/lt-ref-self-async.rs:37:62 | LL | async fn box_pin_Self(self: Box>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#28r -error: aborting due to 6 previous errors +error: lifetime may not live long enough + --> $DIR/lt-ref-self-async.rs:37:67 + | +LL | async fn box_pin_Self(self: Box>, f: &u32) -> &u32 { + | _________________________________________-_________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` -For more information about this error, try `rustc --explain E0106`. +error: aborting due to 12 previous errors + +For more information about this error, try `rustc --explain E0700`. diff --git a/src/test/ui/self/elision/ref-mut-self-async.nll.stderr b/src/test/ui/self/elision/ref-mut-self-async.nll.stderr index 35969659b19d..cfe91dde3735 100644 --- a/src/test/ui/self/elision/ref-mut-self-async.nll.stderr +++ b/src/test/ui/self/elision/ref-mut-self-async.nll.stderr @@ -1,51 +1,123 @@ -error[E0106]: missing lifetime specifier +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds --> $DIR/ref-mut-self-async.rs:15:46 | LL | async fn ref_self(&mut self, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-mut-self-async.rs:23:52 +error: lifetime may not live long enough + --> $DIR/ref-mut-self-async.rs:15:51 + | +LL | async fn ref_self(&mut self, f: &u32) -> &u32 { + | _______________________-___________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-mut-self-async.rs:21:52 | LL | async fn ref_Self(self: &mut Self, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-mut-self-async.rs:29:61 +error: lifetime may not live long enough + --> $DIR/ref-mut-self-async.rs:21:57 + | +LL | async fn ref_Self(self: &mut Self, f: &u32) -> &u32 { + | _____________________________-___________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-mut-self-async.rs:25:61 | LL | async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-mut-self-async.rs:35:61 +error: lifetime may not live long enough + --> $DIR/ref-mut-self-async.rs:25:66 + | +LL | async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 { + | _____________________________________-____________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-mut-self-async.rs:29:61 | LL | async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-mut-self-async.rs:41:70 +error: lifetime may not live long enough + --> $DIR/ref-mut-self-async.rs:29:66 + | +LL | async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 { + | _____________________________________-____________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-mut-self-async.rs:33:70 | LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-mut-self-async.rs:47:70 +error: lifetime may not live long enough + --> $DIR/ref-mut-self-async.rs:33:75 + | +LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { + | _____________________________________________-_____________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-mut-self-async.rs:37:70 | LL | async fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error: aborting due to 6 previous errors +error: lifetime may not live long enough + --> $DIR/ref-mut-self-async.rs:37:75 + | +LL | async fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { + | _____________________________________________-_____________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` -For more information about this error, try `rustc --explain E0106`. +error: aborting due to 12 previous errors + +For more information about this error, try `rustc --explain E0700`. diff --git a/src/test/ui/self/elision/ref-mut-struct-async.nll.stderr b/src/test/ui/self/elision/ref-mut-struct-async.nll.stderr index a70dcf5b0ad1..98fa5e254518 100644 --- a/src/test/ui/self/elision/ref-mut-struct-async.nll.stderr +++ b/src/test/ui/self/elision/ref-mut-struct-async.nll.stderr @@ -1,43 +1,103 @@ -error[E0106]: missing lifetime specifier +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds --> $DIR/ref-mut-struct-async.rs:15:56 | LL | async fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-mut-struct-async.rs:21:65 +error: lifetime may not live long enough + --> $DIR/ref-mut-struct-async.rs:15:61 + | +LL | async fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 { + | _______________________________-_____________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-mut-struct-async.rs:19:65 | LL | async fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-mut-struct-async.rs:27:65 +error: lifetime may not live long enough + --> $DIR/ref-mut-struct-async.rs:19:70 + | +LL | async fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 { + | _______________________________________-______________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-mut-struct-async.rs:23:65 | LL | async fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-mut-struct-async.rs:33:74 +error: lifetime may not live long enough + --> $DIR/ref-mut-struct-async.rs:23:70 + | +LL | async fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 { + | _______________________________________-______________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-mut-struct-async.rs:27:74 | LL | async fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-mut-struct-async.rs:39:74 +error: lifetime may not live long enough + --> $DIR/ref-mut-struct-async.rs:27:79 + | +LL | async fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { + | _______________________________________________-_______________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-mut-struct-async.rs:31:74 | LL | async fn box_pin_ref_Struct(self: Box>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error: aborting due to 5 previous errors +error: lifetime may not live long enough + --> $DIR/ref-mut-struct-async.rs:31:79 + | +LL | async fn box_pin_ref_Struct(self: Box>, f: &u32) -> &u32 { + | _______________________________________________-_______________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` -For more information about this error, try `rustc --explain E0106`. +error: aborting due to 10 previous errors + +For more information about this error, try `rustc --explain E0700`. diff --git a/src/test/ui/self/elision/ref-self-async.nll.stderr b/src/test/ui/self/elision/ref-self-async.nll.stderr index ae17ba9839d2..f991f6d9f7fa 100644 --- a/src/test/ui/self/elision/ref-self-async.nll.stderr +++ b/src/test/ui/self/elision/ref-self-async.nll.stderr @@ -1,59 +1,143 @@ -error[E0106]: missing lifetime specifier +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds --> $DIR/ref-self-async.rs:24:42 | LL | async fn ref_self(&self, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-self-async.rs:32:48 +error: lifetime may not live long enough + --> $DIR/ref-self-async.rs:24:47 + | +LL | async fn ref_self(&self, f: &u32) -> &u32 { + | _______________________-_______________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-self-async.rs:30:48 | LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-self-async.rs:38:57 +error: lifetime may not live long enough + --> $DIR/ref-self-async.rs:30:53 + | +LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 { + | _____________________________-_______________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-self-async.rs:34:57 | LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-self-async.rs:44:57 +error: lifetime may not live long enough + --> $DIR/ref-self-async.rs:34:62 + | +LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { + | _____________________________________-________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-self-async.rs:38:57 | LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-self-async.rs:50:66 +error: lifetime may not live long enough + --> $DIR/ref-self-async.rs:38:62 + | +LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { + | _____________________________________-________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-self-async.rs:42:66 | LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-self-async.rs:56:66 +error: lifetime may not live long enough + --> $DIR/ref-self-async.rs:42:71 + | +LL | async fn box_box_ref_Self(self: Box>, f: &u32) -> &u32 { + | _____________________________________________-_________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-self-async.rs:46:66 | LL | async fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-self-async.rs:62:69 +error: lifetime may not live long enough + --> $DIR/ref-self-async.rs:46:71 + | +LL | async fn box_pin_ref_Self(self: Box>, f: &u32) -> &u32 { + | _____________________________________________-_________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-self-async.rs:50:69 | LL | async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 { - | ^ + | ^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error: aborting due to 7 previous errors +error: lifetime may not live long enough + --> $DIR/ref-self-async.rs:50:73 + | +LL | async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 { + | ____________________________________________-____________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` -For more information about this error, try `rustc --explain E0106`. +error: aborting due to 14 previous errors + +For more information about this error, try `rustc --explain E0700`. diff --git a/src/test/ui/self/elision/ref-struct-async.nll.stderr b/src/test/ui/self/elision/ref-struct-async.nll.stderr index b4f12d7057db..437d403e044e 100644 --- a/src/test/ui/self/elision/ref-struct-async.nll.stderr +++ b/src/test/ui/self/elision/ref-struct-async.nll.stderr @@ -1,43 +1,103 @@ -error[E0106]: missing lifetime specifier +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds --> $DIR/ref-struct-async.rs:15:52 | LL | async fn ref_Struct(self: &Struct, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-struct-async.rs:21:61 +error: lifetime may not live long enough + --> $DIR/ref-struct-async.rs:15:57 + | +LL | async fn ref_Struct(self: &Struct, f: &u32) -> &u32 { + | _______________________________-_________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-struct-async.rs:19:61 | LL | async fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-struct-async.rs:27:61 +error: lifetime may not live long enough + --> $DIR/ref-struct-async.rs:19:66 + | +LL | async fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 { + | _______________________________________-__________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-struct-async.rs:23:61 | LL | async fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-struct-async.rs:33:70 +error: lifetime may not live long enough + --> $DIR/ref-struct-async.rs:23:66 + | +LL | async fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 { + | _______________________________________-__________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-struct-async.rs:27:70 | LL | async fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error[E0106]: missing lifetime specifier - --> $DIR/ref-struct-async.rs:39:66 +error: lifetime may not live long enough + --> $DIR/ref-struct-async.rs:27:75 + | +LL | async fn box_box_ref_Struct(self: Box>, f: &u32) -> &u32 { + | _______________________________________________-___________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` + +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/ref-struct-async.rs:31:66 | LL | async fn box_pin_Struct(self: Box>, f: &u32) -> &u32 { - | ^ + | ^^^^ | - = note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple. + = note: hidden type `impl std::future::Future` captures lifetime '_#18r -error: aborting due to 5 previous errors +error: lifetime may not live long enough + --> $DIR/ref-struct-async.rs:31:71 + | +LL | async fn box_pin_Struct(self: Box>, f: &u32) -> &u32 { + | ___________________________________________-___________________________^ + | | | + | | lifetime `'_` defined here + | | lifetime `'_` defined here +LL | | f +LL | | } + | |_____^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_` -For more information about this error, try `rustc --explain E0106`. +error: aborting due to 10 previous errors + +For more information about this error, try `rustc --explain E0700`.