Skip to content

Commit 99fa123

Browse files
committed
bless existing test with compare-mode=nll and remove test
1 parent ca9d725 commit 99fa123

8 files changed

+66
-237
lines changed

src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.krisskross.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/project-fn-ret-invariant-nll.rs:63:5
2+
--> $DIR/project-fn-ret-invariant-nll.rs:64:5
33
|
44
LL | fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
55
| -- -- lifetime `'b` defined here
@@ -15,7 +15,7 @@ LL | (a, b)
1515
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
1616

1717
error: lifetime may not live long enough
18-
--> $DIR/project-fn-ret-invariant-nll.rs:63:5
18+
--> $DIR/project-fn-ret-invariant-nll.rs:64:5
1919
|
2020
LL | fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
2121
| -- -- lifetime `'b` defined here

src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.oneuse.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ LL | let a = bar(f, x);
1515
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
1616

1717
error: lifetime may not live long enough
18-
--> $DIR/project-fn-ret-invariant-nll.rs:47:13
18+
--> $DIR/project-fn-ret-invariant-nll.rs:46:13
1919
|
2020
LL | fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
2121
| -- -- lifetime `'b` defined here
2222
| |
2323
| lifetime `'a` defined here
24-
...
25-
LL | let b = bar(f, y);
24+
LL | let f = foo; // <-- No consistent type can be inferred for `f` here.
25+
LL | let a = bar(f, x);
2626
| ^^^^^^^^^ argument requires that `'b` must outlive `'a`
2727
|
2828
= help: consider adding the following bound: `'b: 'a`
29-
= note: requirement occurs because of the type `Type<'_>`, which makes the generic argument `'_` invariant
30-
= note: the struct `Type<'a>` is invariant over the parameter `'a`
29+
= note: requirement occurs because of a function pointer to `foo`
30+
= note: the function `foo` is invariant over the parameter `'a`
3131
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
3232

3333
help: `'a` and `'b` must be the same: replace one with the other

src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
4444
fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
4545
let f = foo; // <-- No consistent type can be inferred for `f` here.
4646
let a = bar(f, x); //[oneuse]~ ERROR lifetime may not live long enough
47-
let b = bar(f, y); //[oneuse]~ ERROR lifetime may not live long enough
47+
//[oneuse]~^ ERROR lifetime may not live long enough
48+
let b = bar(f, y);
4849
(a, b)
4950
}
5051

src/test/ui/associated-types/cache/project-fn-ret-invariant-nll.transmute.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/project-fn-ret-invariant-nll.rs:56:5
2+
--> $DIR/project-fn-ret-invariant-nll.rs:57:5
33
|
44
LL | fn baz<'a, 'b>(x: Type<'a>) -> Type<'static> {
55
| -- lifetime `'a` defined here

src/test/ui/async-await/issues/issue-72312.nll.stderr

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
error[E0521]: borrowed data escapes outside of associated function
2-
--> $DIR/issue-72312.rs:20:24
2+
--> $DIR/issue-72312.rs:20:9
33
|
44
LL | pub async fn start(&self) {
55
| -----
66
| |
77
| `self` is a reference that is only valid in the associated function body
88
| let's call the lifetime of this reference `'1`
99
...
10-
LL | require_static(async move {
11-
| ________________________^
10+
LL | / require_static(async move {
1211
LL | |
1312
LL | |
1413
LL | |
1514
LL | |
1615
LL | | &self;
1716
LL | | });
18-
| | ^
19-
| | |
20-
| |_________`self` escapes the associated function body here
21-
| argument requires that `'1` must outlive `'static`
17+
| | ^
18+
| | |
19+
| |__________`self` escapes the associated function body here
20+
| argument requires that `'1` must outlive `'static`
2221

2322
error: aborting due to previous error
2423

src/test/ui/nll/impl-dyn-trait-static-bound.rs

-116
This file was deleted.

src/test/ui/nll/impl-dyn-trait-static-bound.stderr

-105
This file was deleted.

src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-nll.stderr

+50
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ LL | val.use_self::<T>()
1010
| |
1111
| `val` escapes the function body here
1212
| argument requires that `'a` must outlive `'static`
13+
|
14+
note: the used `impl` has a `'static` requirement
15+
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:19:32
16+
|
17+
LL | impl<T> MyTrait<T> for dyn ObjectTrait<T> {
18+
| ^^^^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
19+
LL | fn use_self<K>(&self) -> &() { panic!() }
20+
| -------- calling this method introduces the `impl`'s 'static` requirement
21+
help: consider relaxing the implicit `'static` requirement
22+
|
23+
LL | impl<T> MyTrait<T> for dyn ObjectTrait<T> + '_ {
24+
| ++++
1325

1426
error[E0521]: borrowed data escapes outside of function
1527
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:74:9
@@ -23,6 +35,18 @@ LL | val.use_self()
2335
| |
2436
| `val` escapes the function body here
2537
| argument requires that `'a` must outlive `'static`
38+
|
39+
note: the used `impl` has a `'static` requirement
40+
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:69:14
41+
|
42+
LL | impl dyn ObjectTrait {
43+
| ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
44+
LL | fn use_self(&self) -> &() { panic!() }
45+
| -------- calling this method introduces the `impl`'s 'static` requirement
46+
help: consider relaxing the implicit `'static` requirement
47+
|
48+
LL | impl dyn ObjectTrait + '_ {
49+
| ++++
2650

2751
error[E0521]: borrowed data escapes outside of function
2852
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:94:9
@@ -36,6 +60,19 @@ LL | val.use_self()
3660
| |
3761
| `val` escapes the function body here
3862
| argument requires that `'a` must outlive `'static`
63+
|
64+
note: the used `impl` has a `'static` requirement
65+
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:91:26
66+
|
67+
LL | fn use_self(&self) -> &() { panic!() }
68+
| -------- calling this method introduces the `impl`'s 'static` requirement
69+
...
70+
LL | impl MyTrait for dyn ObjectTrait {}
71+
| ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
72+
help: consider relaxing the implicit `'static` requirement
73+
|
74+
LL | impl MyTrait for dyn ObjectTrait + '_ {}
75+
| ++++
3976

4077
error[E0521]: borrowed data escapes outside of function
4178
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:114:9
@@ -49,6 +86,19 @@ LL | MyTrait::use_self(val)
4986
| |
5087
| `val` escapes the function body here
5188
| argument requires that `'a` must outlive `'static`
89+
|
90+
note: the used `impl` has a `'static` requirement
91+
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:110:26
92+
|
93+
LL | fn use_self(&self) -> &() { panic!() }
94+
| -------- calling this method introduces the `impl`'s 'static` requirement
95+
...
96+
LL | impl MyTrait for dyn ObjectTrait {}
97+
| ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
98+
help: consider relaxing the implicit `'static` requirement
99+
|
100+
LL | impl MyTrait for dyn ObjectTrait + '_ {}
101+
| ++++
52102

53103
error: aborting due to 4 previous errors
54104

0 commit comments

Comments
 (0)