Skip to content

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
}

src/test/ui/nll/lint-no-err.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
// when buffering lints, which resulted in ICE later on,
55
// see #94502.
66

7-
// Errors with `nll` which is already tested in enough other tests,
8-
// so we ignore it here.
9-
//
10-
// ignore-compare-mode-nll
11-
127
struct Repro;
138
impl Repro {
149
fn get(&self) -> &i32 {

src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.stderr renamed to src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.base.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0309]: the associated type `<T as MyTrait<'a>>::Output` may not live long enough
2-
--> $DIR/projection-where-clause-env-wrong-bound.rs:15:5
2+
--> $DIR/projection-where-clause-env-wrong-bound.rs:19:5
33
|
44
LL | bar::<T::Output>()
55
| ^^^^^^^^^^^^^^^^
66
|
77
= help: consider adding an explicit lifetime bound `<T as MyTrait<'a>>::Output: 'a`...
88
= note: ...so that the type `<T as MyTrait<'a>>::Output` will meet its required lifetime bounds...
99
note: ...that is required by this bound
10-
--> $DIR/projection-where-clause-env-wrong-bound.rs:29:8
10+
--> $DIR/projection-where-clause-env-wrong-bound.rs:33:8
1111
|
1212
LL | T: 'a,
1313
| ^^

src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0309]: the associated type `<T as MyTrait<'_>>::Output` may not live long enough
2-
--> $DIR/projection-where-clause-env-wrong-bound.rs:15:5
2+
--> $DIR/projection-where-clause-env-wrong-bound.rs:19:5
33
|
44
LL | bar::<T::Output>()
55
| ^^^^^^^^^^^^^^^^

src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.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
// Test that we are able to establish that `<T as
26
// MyTrait<'a>>::Output` outlives `'b` here. We need to prove however
37
// that `<T as MyTrait<'a>>::Output` outlives `'a`, so we also have to

src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.stderr renamed to src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.base.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0309]: the associated type `<T as MyTrait<'a>>::Output` may not live long enough
2-
--> $DIR/projection-where-clause-env-wrong-lifetime.rs:14:5
2+
--> $DIR/projection-where-clause-env-wrong-lifetime.rs:18:5
33
|
44
LL | bar::<<T as MyTrait<'a>>::Output>()
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= help: consider adding an explicit lifetime bound `<T as MyTrait<'a>>::Output: 'a`...
88
= note: ...so that the type `<T as MyTrait<'a>>::Output` will meet its required lifetime bounds...
99
note: ...that is required by this bound
10-
--> $DIR/projection-where-clause-env-wrong-lifetime.rs:20:8
10+
--> $DIR/projection-where-clause-env-wrong-lifetime.rs:25:8
1111
|
1212
LL | T: 'a,
1313
| ^^

src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0309]: the associated type `<T as MyTrait<'_>>::Output` may not live long enough
2-
--> $DIR/projection-where-clause-env-wrong-lifetime.rs:14:5
2+
--> $DIR/projection-where-clause-env-wrong-lifetime.rs:18:5
33
|
44
LL | bar::<<T as MyTrait<'a>>::Output>()
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.rs

Lines changed: 6 additions & 1 deletion
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
// Test that if we need to prove that `<T as MyTrait<'a>>::Output:
26
// 'a`, but we only know that `<T as MyTrait<'b>>::Output: 'a`, that
37
// doesn't suffice.
@@ -12,7 +16,8 @@ where
1216
<T as MyTrait<'b>>::Output: 'a,
1317
{
1418
bar::<<T as MyTrait<'a>>::Output>()
15-
//~^ ERROR the associated type `<T as MyTrait<'a>>::Output` may not live long enough
19+
//[base]~^ ERROR the associated type `<T as MyTrait<'a>>::Output` may not live long enough
20+
//[nll]~^^ ERROR the associated type `<T as MyTrait<'_>>::Output` may not live long enough
1621
}
1722

1823
fn bar<'a, T>() -> &'a ()

0 commit comments

Comments
 (0)