Skip to content

Commit e818f45

Browse files
committed
Use revisions instead of nll compare mode for /self/ ui tests
1 parent 3f391b8 commit e818f45

36 files changed

+360
-192
lines changed

src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.stderr renamed to src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.base.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
error[E0623]: lifetime mismatch
2-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:8:52
2+
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:11:52
33
|
44
LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
55
| ---- ---- ^ ...but data from `f` is returned here
66
| |
77
| this parameter and the return type are declared with different lifetimes...
88

99
error[E0623]: lifetime mismatch
10-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:11:82
10+
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:82
1111
|
1212
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
1313
| ---- ----------------- ^ ...but data from `f` is returned here
1414
| |
1515
| this parameter and the return type are declared with different lifetimes...
1616

1717
error[E0623]: lifetime mismatch
18-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:17:64
18+
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:22:64
1919
|
2020
LL | async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
2121
| ------ --- ^^^ ...but data from `arg` is returned here

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:8:52
2+
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:11:52
33
|
44
LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
55
| - - ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
@@ -8,7 +8,7 @@ LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
88
| let's call the lifetime of this reference `'2`
99

1010
error: lifetime may not live long enough
11-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:11:75
11+
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:15:75
1212
|
1313
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
1414
| - - ^^^^^^^^^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
@@ -17,7 +17,7 @@ LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (
1717
| let's call the lifetime of this reference `'2`
1818

1919
error: lifetime may not live long enough
20-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:17:64
20+
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:22:64
2121
|
2222
LL | async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
2323
| -- - ^^^ associated function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
// edition:2018
2+
// revisions: base nll
3+
// ignore-compare-mode-nll
4+
//[nll] compile-flags: -Z borrowck=mir
25

36
use std::pin::Pin;
47

58
struct Foo;
69

710
impl Foo {
811
async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
9-
//~^ ERROR lifetime mismatch
12+
//[base]~^ ERROR lifetime mismatch
13+
//[nll]~^^ lifetime may not live long enough
1014

1115
async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
12-
//~^ ERROR lifetime mismatch
16+
//[base]~^ ERROR lifetime mismatch
17+
//[nll]~^^ lifetime may not live long enough
1318
}
1419

1520
type Alias<T> = Pin<T>;
1621
impl Foo {
17-
async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg } //~ ERROR E0623
22+
async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
23+
//[base]~^ ERROR E0623
24+
//[nll]~^^ lifetime may not live long enough
1825
}
1926

2027
fn main() {}

src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.stderr renamed to src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.base.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0623]: lifetime mismatch
2-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:6:46
2+
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:10:46
33
|
44
LL | fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
55
| ---- ---- ^ ...but data from `f` is returned here
@@ -13,7 +13,7 @@ LL | fn a<'a>(self: Pin<&'a Foo>, f: &'a Foo) -> &Foo { f }
1313
| ++++ ++ ++
1414

1515
error[E0623]: lifetime mismatch
16-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:8:76
16+
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:14:76
1717
|
1818
LL | fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
1919
| ---- ----------------- ^ ...but data from `f` is returned here
@@ -27,7 +27,7 @@ LL | fn c<'a>(self: Pin<&'a Self>, f: &'a Foo, g: &Foo) -> (Pin<&Foo>, &Foo)
2727
| ++++ ++ ++
2828

2929
error[E0623]: lifetime mismatch
30-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:13:58
30+
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:21:58
3131
|
3232
LL | fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
3333
| ------ --- ^^^ ...but data from `arg` is returned here

src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.nll.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:6:46
2+
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:10:46
33
|
44
LL | fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
55
| - - ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
@@ -8,7 +8,7 @@ LL | fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
88
| let's call the lifetime of this reference `'2`
99

1010
error: lifetime may not live long enough
11-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:8:69
11+
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:14:69
1212
|
1313
LL | fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
1414
| - - ^^^^^^^^^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
@@ -17,7 +17,7 @@ LL | fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self,
1717
| let's call the lifetime of this reference `'2`
1818

1919
error: lifetime may not live long enough
20-
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:13:58
20+
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:21:58
2121
|
2222
LL | fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
2323
| -- ---- has type `Pin<&'1 Foo>` ^^^ associated function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
1+
// revisions: base nll
2+
// ignore-compare-mode-nll
3+
//[nll] compile-flags: -Z borrowck=mir
4+
15
use std::pin::Pin;
26

37
struct Foo;
48

59
impl Foo {
6-
fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f } //~ ERROR E0623
10+
fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
11+
//[base]~^ ERROR E0623
12+
//[nll]~^^ lifetime may not live long enough
713

8-
fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) } //~ ERROR E0623
14+
fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
15+
//[base]~^ ERROR E0623
16+
//[nll]~^^ lifetime may not live long enough
917
}
1018

1119
type Alias<T> = Pin<T>;
1220
impl Foo {
13-
fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg } //~ ERROR E0623
21+
fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
22+
//[base]~^ ERROR E0623
23+
//[nll]~^^ lifetime may not live long enough
1424
}
1525

1626
fn main() {}

src/test/ui/self/elision/lt-ref-self-async.stderr renamed to src/test/ui/self/elision/lt-ref-self-async.base.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0623]: lifetime mismatch
2-
--> $DIR/lt-ref-self-async.rs:13:9
2+
--> $DIR/lt-ref-self-async.rs:16:9
33
|
44
LL | async fn ref_self(&self, f: &u32) -> &u32 {
55
| ---- ----
@@ -9,7 +9,7 @@ LL | f
99
| ^ ...but data from `f` is returned here
1010

1111
error[E0623]: lifetime mismatch
12-
--> $DIR/lt-ref-self-async.rs:19:9
12+
--> $DIR/lt-ref-self-async.rs:24:9
1313
|
1414
LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 {
1515
| ---- ----
@@ -19,7 +19,7 @@ LL | f
1919
| ^ ...but data from `f` is returned here
2020

2121
error[E0623]: lifetime mismatch
22-
--> $DIR/lt-ref-self-async.rs:23:9
22+
--> $DIR/lt-ref-self-async.rs:30:9
2323
|
2424
LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
2525
| ---- ----
@@ -29,7 +29,7 @@ LL | f
2929
| ^ ...but data from `f` is returned here
3030

3131
error[E0623]: lifetime mismatch
32-
--> $DIR/lt-ref-self-async.rs:27:9
32+
--> $DIR/lt-ref-self-async.rs:36:9
3333
|
3434
LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
3535
| ---- ----
@@ -39,7 +39,7 @@ LL | f
3939
| ^ ...but data from `f` is returned here
4040

4141
error[E0623]: lifetime mismatch
42-
--> $DIR/lt-ref-self-async.rs:31:9
42+
--> $DIR/lt-ref-self-async.rs:42:9
4343
|
4444
LL | async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
4545
| ---- ----
@@ -49,7 +49,7 @@ LL | f
4949
| ^ ...but data from `f` is returned here
5050

5151
error[E0623]: lifetime mismatch
52-
--> $DIR/lt-ref-self-async.rs:35:9
52+
--> $DIR/lt-ref-self-async.rs:48:9
5353
|
5454
LL | async fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
5555
| ---- ----

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/lt-ref-self-async.rs:13:9
2+
--> $DIR/lt-ref-self-async.rs:16:9
33
|
44
LL | async fn ref_self(&self, f: &u32) -> &u32 {
55
| - - let's call the lifetime of this reference `'1`
@@ -9,7 +9,7 @@ LL | f
99
| ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
1010

1111
error: lifetime may not live long enough
12-
--> $DIR/lt-ref-self-async.rs:19:9
12+
--> $DIR/lt-ref-self-async.rs:24:9
1313
|
1414
LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 {
1515
| - - let's call the lifetime of this reference `'1`
@@ -19,7 +19,7 @@ LL | f
1919
| ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
2020

2121
error: lifetime may not live long enough
22-
--> $DIR/lt-ref-self-async.rs:23:9
22+
--> $DIR/lt-ref-self-async.rs:30:9
2323
|
2424
LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
2525
| - - let's call the lifetime of this reference `'1`
@@ -29,7 +29,7 @@ LL | f
2929
| ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
3030

3131
error: lifetime may not live long enough
32-
--> $DIR/lt-ref-self-async.rs:27:9
32+
--> $DIR/lt-ref-self-async.rs:36:9
3333
|
3434
LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
3535
| - - let's call the lifetime of this reference `'1`
@@ -39,7 +39,7 @@ LL | f
3939
| ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
4040

4141
error: lifetime may not live long enough
42-
--> $DIR/lt-ref-self-async.rs:31:9
42+
--> $DIR/lt-ref-self-async.rs:42:9
4343
|
4444
LL | async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
4545
| - - let's call the lifetime of this reference `'1`
@@ -49,7 +49,7 @@ LL | f
4949
| ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
5050

5151
error: lifetime may not live long enough
52-
--> $DIR/lt-ref-self-async.rs:35:9
52+
--> $DIR/lt-ref-self-async.rs:48:9
5353
|
5454
LL | async fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
5555
| - - let's call the lifetime of this reference `'1`

src/test/ui/self/elision/lt-ref-self-async.rs

+21-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// edition:2018
2+
// revisions: base nll
3+
// ignore-compare-mode-nll
4+
//[nll] compile-flags: -Z borrowck=mir
25

36
#![allow(non_snake_case)]
47

@@ -10,29 +13,41 @@ impl<'a> Struct<'a> {
1013
// Test using `&self` sugar:
1114

1215
async fn ref_self(&self, f: &u32) -> &u32 {
13-
f //~ ERROR lifetime mismatch
16+
f
17+
//[base]~^ ERROR lifetime mismatch
18+
//[nll]~^^ ERROR lifetime may not live long enough
1419
}
1520

1621
// Test using `&Self` explicitly:
1722

1823
async fn ref_Self(self: &Self, f: &u32) -> &u32 {
19-
f //~ ERROR lifetime mismatch
24+
f
25+
//[base]~^ ERROR lifetime mismatch
26+
//[nll]~^^ ERROR lifetime may not live long enough
2027
}
2128

2229
async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
23-
f //~ ERROR lifetime mismatch
30+
f
31+
//[base]~^ ERROR lifetime mismatch
32+
//[nll]~^^ ERROR lifetime may not live long enough
2433
}
2534

2635
async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
27-
f //~ ERROR lifetime mismatch
36+
f
37+
//[base]~^ ERROR lifetime mismatch
38+
//[nll]~^^ ERROR lifetime may not live long enough
2839
}
2940

3041
async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
31-
f //~ ERROR lifetime mismatch
42+
f
43+
//[base]~^ ERROR lifetime mismatch
44+
//[nll]~^^ ERROR lifetime may not live long enough
3245
}
3346

3447
async fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
35-
f //~ ERROR lifetime mismatch
48+
f
49+
//[base]~^ ERROR lifetime mismatch
50+
//[nll]~^^ ERROR lifetime may not live long enough
3651
}
3752
}
3853

src/test/ui/self/elision/lt-ref-self.stderr renamed to src/test/ui/self/elision/lt-ref-self.base.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0623]: lifetime mismatch
2-
--> $DIR/lt-ref-self.rs:11:9
2+
--> $DIR/lt-ref-self.rs:15:9
33
|
44
LL | fn ref_self(&self, f: &u32) -> &u32 {
55
| ---- ----
@@ -15,7 +15,7 @@ LL | fn ref_self<'a>(&'a self, f: &'a u32) -> &u32 {
1515
| ++++ ++ ++
1616

1717
error[E0623]: lifetime mismatch
18-
--> $DIR/lt-ref-self.rs:17:9
18+
--> $DIR/lt-ref-self.rs:23:9
1919
|
2020
LL | fn ref_Self(self: &Self, f: &u32) -> &u32 {
2121
| ---- ----
@@ -31,7 +31,7 @@ LL | fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &u32 {
3131
| ++++ ++ ++
3232

3333
error[E0623]: lifetime mismatch
34-
--> $DIR/lt-ref-self.rs:21:9
34+
--> $DIR/lt-ref-self.rs:29:9
3535
|
3636
LL | fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
3737
| ---- ----
@@ -47,7 +47,7 @@ LL | fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &u32 {
4747
| ++++ ++ ++
4848

4949
error[E0623]: lifetime mismatch
50-
--> $DIR/lt-ref-self.rs:25:9
50+
--> $DIR/lt-ref-self.rs:35:9
5151
|
5252
LL | fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
5353
| ---- ----
@@ -63,7 +63,7 @@ LL | fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &u32 {
6363
| ++++ ++ ++
6464

6565
error[E0623]: lifetime mismatch
66-
--> $DIR/lt-ref-self.rs:29:9
66+
--> $DIR/lt-ref-self.rs:41:9
6767
|
6868
LL | fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
6969
| ---- ----
@@ -79,7 +79,7 @@ LL | fn box_box_ref_Self<'a>(self: Box<Box<&'a Self>>, f: &'a u32) -> &u32 {
7979
| ++++ ++ ++
8080

8181
error[E0623]: lifetime mismatch
82-
--> $DIR/lt-ref-self.rs:33:9
82+
--> $DIR/lt-ref-self.rs:47:9
8383
|
8484
LL | fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
8585
| ---- ----

0 commit comments

Comments
 (0)