Skip to content

Commit

Permalink
bless tests with compare-mode=nll
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Aug 13, 2019
1 parent d7c7c52 commit 18d69c8
Show file tree
Hide file tree
Showing 8 changed files with 538 additions and 136 deletions.
24 changes: 24 additions & 0 deletions src/test/ui/async-await/issues/issue-63388-1.nll.stderr
Original file line number Diff line number Diff line change
@@ -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`.
11 changes: 11 additions & 0 deletions src/test/ui/async-await/issues/issue-63388-2.nll.stderr
Original file line number Diff line number Diff line change
@@ -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`.
Original file line number Diff line number Diff line change
@@ -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 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.
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[E0106]: missing lifetime specifier
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:67
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) }
| ^
| - ^^^^^^^^^^^^^ function was supposed to return data with lifetime `'_` but it is returning data with lifetime `'_`
| |
| lifetime `'_` defined here
| lifetime `'_` defined here

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 bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
| ^^^
|
= note: hidden type `impl std::future::Future` captures lifetime '_#18r

error: lifetime may not live long enough
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:19:62
|
= note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple.
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

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

For more information about this error, try `rustc --explain E0106`.
For more information about this error, try `rustc --explain E0700`.
122 changes: 97 additions & 25 deletions src/test/ui/self/elision/lt-ref-self-async.nll.stderr
Original file line number Diff line number Diff line change
@@ -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: hidden type `impl std::future::Future` captures lifetime '_#28r

error: lifetime may not live long enough
--> $DIR/lt-ref-self-async.rs:25:62
|
= note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple.
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[E0106]: missing lifetime specifier
--> $DIR/lt-ref-self-async.rs:35:57
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: hidden type `impl std::future::Future` captures lifetime '_#28r

error: lifetime may not live long enough
--> $DIR/lt-ref-self-async.rs:29:62
|
= note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple.
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[E0106]: missing lifetime specifier
--> $DIR/lt-ref-self-async.rs:41:66
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<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: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<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:37:62
|
LL | async fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
| ^
| ^^^^
|
= note: hidden type `impl std::future::Future` captures lifetime '_#28r

error: lifetime may not live long enough
--> $DIR/lt-ref-self-async.rs:37:67
|
= note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple.
LL | async fn box_pin_Self(self: Box<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: aborting due to 6 previous errors
error: aborting due to 12 previous errors

For more information about this error, try `rustc --explain E0106`.
For more information about this error, try `rustc --explain E0700`.
122 changes: 97 additions & 25 deletions src/test/ui/self/elision/ref-mut-self-async.nll.stderr
Original file line number Diff line number Diff line change
@@ -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: hidden type `impl std::future::Future` captures lifetime '_#18r

error: lifetime may not live long enough
--> $DIR/ref-mut-self-async.rs:25:66
|
= note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple.
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[E0106]: missing lifetime specifier
--> $DIR/ref-mut-self-async.rs:35:61
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: hidden type `impl std::future::Future` captures lifetime '_#18r

error: lifetime may not live long enough
--> $DIR/ref-mut-self-async.rs:29:66
|
= note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple.
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[E0106]: missing lifetime specifier
--> $DIR/ref-mut-self-async.rs:41:70
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<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: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<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:37:70
|
LL | async fn box_pin_ref_Self(self: Box<Pin<&mut Self>>, f: &u32) -> &u32 {
| ^
| ^^^^
|
= note: hidden type `impl std::future::Future` captures lifetime '_#18r

error: lifetime may not live long enough
--> $DIR/ref-mut-self-async.rs:37:75
|
= note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple.
LL | async fn box_pin_ref_Self(self: Box<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: aborting due to 6 previous errors
error: aborting due to 12 previous errors

For more information about this error, try `rustc --explain E0106`.
For more information about this error, try `rustc --explain E0700`.
Loading

0 comments on commit 18d69c8

Please sign in to comment.