Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit cc97875

Browse files
committed
Use revisions for NLL in nll
1 parent b9f241d commit cc97875

17 files changed

+48
-41
lines changed

src/test/ui/hrtb/hrtb-exists-forall-fn.nll.stderr

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/test/ui/nll/continue-after-missing-main.stderr renamed to src/test/ui/nll/continue-after-missing-main.base.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0601]: `main` function not found in crate `continue_after_missing_main`
2-
--> $DIR/continue-after-missing-main.rs:30:2
2+
--> $DIR/continue-after-missing-main.rs:34:2
33
|
44
LL | }
55
| ^ consider adding a `main` function to `$DIR/continue-after-missing-main.rs`
66

77
error[E0623]: lifetime mismatch
8-
--> $DIR/continue-after-missing-main.rs:28:56
8+
--> $DIR/continue-after-missing-main.rs:32:56
99
|
1010
LL | tableau: Tableau<'data_provider, AdaptedMatrixProvider<'original_data, MP>>,
1111
| ------------------------------------------------------------------ these two types are declared with different lifetimes...

src/test/ui/nll/continue-after-missing-main.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0601]: `main` function not found in crate `continue_after_missing_main`
2-
--> $DIR/continue-after-missing-main.rs:30:2
2+
--> $DIR/continue-after-missing-main.rs:34:2
33
|
44
LL | }
55
| ^ consider adding a `main` function to `$DIR/continue-after-missing-main.rs`

src/test/ui/nll/continue-after-missing-main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// ignore-compare-mode-nll
2+
// revisions: base nll
3+
// [nll]compile-flags: -Zborrowck=mir
4+
15
#![allow(dead_code)]
26

37
struct Tableau<'a, MP> {
@@ -26,5 +30,5 @@ fn create_and_solve_subproblems<'data_provider, 'original_data, MP>(
2630
tableau: Tableau<'data_provider, AdaptedMatrixProvider<'original_data, MP>>,
2731
) {
2832
let _: AdaptedMatrixProvider<'original_data, MP> = tableau.provider().clone_with_extra_bound();
29-
//~^ ERROR lifetime mismatch
33+
//[base]~^ ERROR lifetime mismatch
3034
} //~ ERROR `main` function not found in crate

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
2-
--> $DIR/issue-52213.rs:2:11
2+
--> $DIR/issue-52213.rs:6:11
33
|
44
LL | match (&t,) {
55
| ^^^^^
66
|
77
note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
8-
--> $DIR/issue-52213.rs:1:23
8+
--> $DIR/issue-52213.rs:5:23
99
|
1010
LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
1111
| ^^
1212
note: ...so that the types are compatible
13-
--> $DIR/issue-52213.rs:2:11
13+
--> $DIR/issue-52213.rs:6:11
1414
|
1515
LL | match (&t,) {
1616
| ^^^^^
1717
= note: expected `(&&(T,),)`
1818
found `(&&'a (T,),)`
1919
note: but, the lifetime must be valid for the lifetime `'b` as defined here...
20-
--> $DIR/issue-52213.rs:1:27
20+
--> $DIR/issue-52213.rs:5:27
2121
|
2222
LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
2323
| ^^
2424
note: ...so that reference does not outlive borrowed content
25-
--> $DIR/issue-52213.rs:3:20
25+
--> $DIR/issue-52213.rs:8:20
2626
|
2727
LL | ((u,),) => u,
2828
| ^

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: lifetime may not live long enough
2-
--> $DIR/issue-52213.rs:3:20
2+
--> $DIR/issue-52213.rs:8:20
33
|
44
LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
55
| -- -- lifetime `'b` defined here
66
| |
77
| lifetime `'a` defined here
8-
LL | match (&t,) {
8+
...
99
LL | ((u,),) => u,
1010
| ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
1111
|

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
// ignore-compare-mode-nll
2+
// revisions: base nll
3+
// [nll]compile-flags: -Zborrowck=mir
4+
15
fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
2-
match (&t,) { //~ ERROR cannot infer an appropriate lifetime
6+
match (&t,) {
7+
//[base]~^ ERROR cannot infer an appropriate lifetime
38
((u,),) => u,
9+
//[nll]~^ ERROR lifetime may not live long enough
410
}
511
}
612

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
error[E0308]: mismatched types
2-
--> $DIR/issue-52533-1.rs:9:18
2+
--> $DIR/issue-52533-1.rs:13:18
33
|
44
LL | gimme(|x, y| y)
55
| ^ lifetime mismatch
66
|
77
= note: expected reference `&Foo<'_, '_, u32>`
88
found reference `&Foo<'_, '_, u32>`
99
note: the anonymous lifetime #3 defined here...
10-
--> $DIR/issue-52533-1.rs:9:11
10+
--> $DIR/issue-52533-1.rs:13:11
1111
|
1212
LL | gimme(|x, y| y)
1313
| ^^^^^^^^
1414
note: ...does not necessarily outlive the anonymous lifetime #2 defined here
15-
--> $DIR/issue-52533-1.rs:9:11
15+
--> $DIR/issue-52533-1.rs:13:11
1616
|
1717
LL | gimme(|x, y| y)
1818
| ^^^^^^^^

src/test/ui/nll/issue-52533-1.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-52533-1.rs:9:18
2+
--> $DIR/issue-52533-1.rs:13:18
33
|
44
LL | gimme(|x, y| y)
55
| - - ^ closure was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`

src/test/ui/nll/issue-52533-1.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// ignore-compare-mode-nll
2+
// revisions: base nll
3+
// [nll]compile-flags: -Zborrowck=mir
4+
15
#![allow(warnings)]
26

37
struct Foo<'a, 'b, T: 'a + 'b> { x: &'a T, y: &'b T }
@@ -7,5 +11,6 @@ fn gimme(_: impl for<'a, 'b, 'c> FnOnce(&'a Foo<'a, 'b, u32>,
711

812
fn main() {
913
gimme(|x, y| y)
10-
//~^ ERROR mismatched types [E0308]
14+
//[base]~^ ERROR mismatched types [E0308]
15+
//[nll]~^^ ERROR lifetime may not live long enough
1116
}

0 commit comments

Comments
 (0)