Skip to content

Commit cbf54fa

Browse files
authored
Rollup merge of #95591 - jackh726:nll-revisions-1, r=oli-obk
Use revisions to track NLL test output (part 1) The idea here is 2 fold: 1) When we eventually do make NLL default on, that PR should be systematic in "delete revisions and corresponding error annotations" 2) This allows us to look at test NLL outputs in chunks. (Though, I've opted here not to "mark" these tests. There are some tests with NLL revisions *now* that will be missed. I expect we do a second pass once we have all the tests with NLL revisions; these tests should be easy enough to eyeball.) The actual review here should be "easy", but a bit tedious. I expect we should manually go through each test output and confirm it's okay. The majority of these are either: 1) Only span change (the one I see most common is highlighting an entire function call, rather than just the function name in that call) 2) "E0308 mismatched types" -> "lifetime does not live long enough" 3) "E0495 cannot infer an appropriate lifetime for lifetime parameter" -> "lifetime does not live long enough" 4) "E0312 lifetime of reference outlives lifetime of borrowed content" -> "lifetime does not live long enough" 5) "E0759 `XXX` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement" -> "lifetime does not live long enough" 6) "E0623 lifetime mismatch" -> "lifetime does not live long enough" Other than the now lack of an error code, most of these look fine (with most giving more helpful suggestions now). `rfc1623` output isn't great. cc ``@marmeladema`` if you want to look through these Let's r? ``@oli-obk`` since you've commented on the Zulip thread ;)
2 parents 42ab448 + f881bf7 commit cbf54fa

File tree

111 files changed

+588
-328
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+588
-328
lines changed

src/test/ui/nll/issue-50716.stderr renamed to src/test/ui/nll/issue-50716.base.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0308]: mismatched types
2-
--> $DIR/issue-50716.rs:14:9
2+
--> $DIR/issue-50716.rs:18:9
33
|
44
LL | let _x = *s;
55
| ^^ lifetime mismatch
66
|
77
= note: expected type `<<&'a T as A>::X as Sized>`
88
found type `<<&'static T as A>::X as Sized>`
99
note: the lifetime `'a` as defined here...
10-
--> $DIR/issue-50716.rs:9:8
10+
--> $DIR/issue-50716.rs:13:8
1111
|
1212
LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>)
1313
| ^^

src/test/ui/nll/issue-50716.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/issue-50716.rs:14:14
2+
--> $DIR/issue-50716.rs:18:14
33
|
44
LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>)
55
| -- lifetime `'a` defined here

src/test/ui/nll/issue-50716.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// Regression test for the issue #50716: NLL ignores lifetimes bounds
33
// derived from `Sized` requirements
44

5+
// revisions: base nll
6+
// ignore-compare-mode-nll
7+
//[nll] compile-flags: -Z borrowck=mir
8+
59
trait A {
610
type X: ?Sized;
711
}

src/test/ui/nll/issue-52742.stderr renamed to src/test/ui/nll/issue-52742.base.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
error[E0312]: lifetime of reference outlives lifetime of borrowed content...
2-
--> $DIR/issue-52742.rs:12:18
2+
--> $DIR/issue-52742.rs:17:18
33
|
44
LL | self.y = b.z
55
| ^^^
66
|
77
note: ...the reference is valid for the lifetime `'_` as defined here...
8-
--> $DIR/issue-52742.rs:10:10
8+
--> $DIR/issue-52742.rs:15:10
99
|
1010
LL | impl Foo<'_, '_> {
1111
| ^^
1212
note: ...but the borrowed content is only valid for the anonymous lifetime defined here
13-
--> $DIR/issue-52742.rs:11:31
13+
--> $DIR/issue-52742.rs:16:31
1414
|
1515
LL | fn take_bar(&mut self, b: Bar<'_>) {
1616
| ^^^^^^^

src/test/ui/nll/issue-52742.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/issue-52742.rs:12:9
2+
--> $DIR/issue-52742.rs:17:9
33
|
44
LL | fn take_bar(&mut self, b: Bar<'_>) {
55
| --------- -- let's call this `'1`

src/test/ui/nll/issue-52742.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// revisions: base nll
2+
// ignore-compare-mode-nll
3+
//[nll] compile-flags: -Z borrowck=mir
4+
5+
16
struct Foo<'a, 'b> {
27
x: &'a u32,
38
y: &'b u32,

src/test/ui/nll/issue-55394.stderr renamed to src/test/ui/nll/issue-55394.base.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'s` due to conflicting requirements
2-
--> $DIR/issue-55394.rs:9:9
2+
--> $DIR/issue-55394.rs:13:9
33
|
44
LL | Foo { bar }
55
| ^^^
66
|
77
note: first, the lifetime cannot outlive the anonymous lifetime defined here...
8-
--> $DIR/issue-55394.rs:8:17
8+
--> $DIR/issue-55394.rs:12:17
99
|
1010
LL | fn new(bar: &mut Bar) -> Self {
1111
| ^^^^^^^^
1212
note: ...so that reference does not outlive borrowed content
13-
--> $DIR/issue-55394.rs:9:15
13+
--> $DIR/issue-55394.rs:13:15
1414
|
1515
LL | Foo { bar }
1616
| ^^^
1717
note: but, the lifetime must be valid for the lifetime `'_` as defined here...
18-
--> $DIR/issue-55394.rs:7:10
18+
--> $DIR/issue-55394.rs:11:10
1919
|
2020
LL | impl Foo<'_> {
2121
| ^^
2222
note: ...so that the types are compatible
23-
--> $DIR/issue-55394.rs:9:9
23+
--> $DIR/issue-55394.rs:13:9
2424
|
2525
LL | Foo { bar }
2626
| ^^^^^^^^^^^

src/test/ui/nll/issue-55394.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/issue-55394.rs:9:9
2+
--> $DIR/issue-55394.rs:13:9
33
|
44
LL | fn new(bar: &mut Bar) -> Self {
55
| - ---- return type is Foo<'2>

src/test/ui/nll/issue-55394.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// revisions: base nll
2+
// ignore-compare-mode-nll
3+
//[nll] compile-flags: -Z borrowck=mir
4+
15
struct Bar;
26

37
struct Foo<'s> {

src/test/ui/nll/issue-55401.stderr renamed to src/test/ui/nll/issue-55401.base.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error[E0312]: lifetime of reference outlives lifetime of borrowed content...
2-
--> $DIR/issue-55401.rs:3:5
2+
--> $DIR/issue-55401.rs:7:5
33
|
44
LL | *y
55
| ^^
66
|
77
= note: ...the reference is valid for the static lifetime...
88
note: ...but the borrowed content is only valid for the lifetime `'a` as defined here
9-
--> $DIR/issue-55401.rs:1:47
9+
--> $DIR/issue-55401.rs:5:47
1010
|
1111
LL | fn static_to_a_to_static_through_ref_in_tuple<'a>(x: &'a u32) -> &'static u32 {
1212
| ^^

0 commit comments

Comments
 (0)