Skip to content

Commit d7c7c52

Browse files
committed
bless tests
1 parent ad214fe commit d7c7c52

7 files changed

+27
-146
lines changed

src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,10 @@ struct Foo;
88

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

1513
async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
16-
//~^ ERROR missing lifetime specifier
17-
//~| ERROR cannot infer an appropriate lifetime
18-
//~| ERROR missing lifetime specifier
19-
//~| ERROR cannot infer an appropriate lifetime
20-
// FIXME: should be E0623?
14+
//~^ ERROR lifetime mismatch
2115
}
2216

2317
type Alias<T> = Pin<T>;
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,29 @@
1-
error[E0106]: missing lifetime specifier
1+
error[E0623]: lifetime mismatch
22
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:10:45
33
|
44
LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
5-
| ^
6-
|
7-
= note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple.
8-
9-
error[E0106]: missing lifetime specifier
10-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:60
11-
|
12-
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
13-
| ^
14-
|
15-
= note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple.
5+
| ---- ^^^^
6+
| | |
7+
| | ...but data from `f` is returned here
8+
| this parameter and the return type are declared with different lifetimes...
169

17-
error[E0106]: missing lifetime specifier
18-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:67
19-
|
20-
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
21-
| ^
22-
|
23-
= note: return-position elided lifetimes require exactly one input-position elided lifetime, found multiple.
24-
25-
error: cannot infer an appropriate lifetime
26-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:10:33
27-
|
28-
LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
29-
| ^ ---- this return type evaluates to the `'static` lifetime...
30-
| |
31-
| ...but this borrow...
32-
|
33-
note: ...can't outlive the lifetime '_ as defined on the method body at 10:26
34-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:10:26
35-
|
36-
LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
37-
| ^
38-
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
39-
|
40-
LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo + '_ { f }
41-
| ^^^^^^^^^
42-
43-
error: cannot infer an appropriate lifetime
44-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:16
45-
|
46-
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
47-
| ^^^^ ...but this borrow... ----------------- this return type evaluates to the `'static` lifetime...
48-
|
49-
note: ...can't outlive the lifetime '_ as defined on the method body at 15:26
50-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:26
51-
|
52-
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
53-
| ^
54-
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
55-
|
56-
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) + '_ { (self, f) }
57-
| ^^^^^^^^^^^^^^^^^^^^^^
58-
59-
error: cannot infer an appropriate lifetime
60-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:34
61-
|
62-
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
63-
| ^ ----------------- this return type evaluates to the `'static` lifetime...
64-
| |
65-
| ...but this borrow...
66-
|
67-
note: ...can't outlive the lifetime '_ as defined on the method body at 15:26
68-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:26
10+
error[E0623]: lifetime mismatch
11+
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:13:55
6912
|
7013
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
71-
| ^
72-
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
73-
|
74-
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) + '_ { (self, f) }
75-
| ^^^^^^^^^^^^^^^^^^^^^^
14+
| ----- ^^^^^^^^^^^^^^^^^
15+
| | |
16+
| | ...but data from `f` is returned here
17+
| this parameter and the return type are declared with different lifetimes...
7618

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

86-
error: aborting due to 7 previous errors
28+
error: aborting due to 3 previous errors
8729

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

src/test/ui/self/elision/ref-mut-self-async.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | async fn ref_self(&mut self, f: &u32) -> &u32 {
88
| this parameter and the return type are declared with different lifetimes...
99

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

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

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

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

4646
error[E0623]: lifetime mismatch
47-
--> $DIR/ref-mut-self-async.rs:40:70
47+
--> $DIR/ref-mut-self-async.rs:37:70
4848
|
4949
LL | async fn box_pin_ref_Self(self: Box<Pin<&mut Self>>, f: &u32) -> &u32 {
5050
| --------- ^^^^

src/test/ui/self/elision/ref-self-async.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | async fn ref_self(&self, f: &u32) -> &u32 {
88
| this parameter and the return type are declared with different lifetimes...
99

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

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

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

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

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

5555
error[E0623]: lifetime mismatch
56-
--> $DIR/ref-self-async.rs:53:69
56+
--> $DIR/ref-self-async.rs:50:69
5757
|
5858
LL | async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 {
5959
| ----- ^^^

src/test/ui/self/self_lifetime-async.nll.stderr

-11
This file was deleted.
+1-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1-
// FIXME: Investigate why `self_lifetime.rs` is check-pass but this isn't.
2-
1+
// check-pass
32
// edition:2018
43

54
#![feature(async_await)]
65

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

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

2016
fn main() {}

src/test/ui/self/self_lifetime-async.stderr

-39
This file was deleted.

0 commit comments

Comments
 (0)