Skip to content

Commit 12a2d79

Browse files
committed
Use revisions for NLL in various directories
1 parent 99daba2 commit 12a2d79

33 files changed

+180
-120
lines changed

src/test/ui/associated-type-bounds/implied-region-constraints.stderr renamed to src/test/ui/associated-type-bounds/implied-region-constraints.base.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0623]: lifetime mismatch
2-
--> $DIR/implied-region-constraints.rs:17:64
2+
--> $DIR/implied-region-constraints.rs:21:64
33
|
44
LL | fn _bad_st<'a, 'b, T>(x: St<'a, 'b, T>)
55
| ------------- this type is declared with multiple lifetimes...
@@ -8,7 +8,7 @@ LL | let _failure_proves_not_implied_outlives_region_b: &'b T = &x.f0;
88
| ^^^^^ ...but data with one lifetime flows into the other here
99

1010
error[E0623]: lifetime mismatch
11-
--> $DIR/implied-region-constraints.rs:38:72
11+
--> $DIR/implied-region-constraints.rs:43:72
1212
|
1313
LL | fn _bad_en7<'a, 'b, T>(x: En7<'a, 'b, T>)
1414
| -------------- this type is declared with multiple lifetimes...

src/test/ui/associated-type-bounds/implied-region-constraints.nll.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/implied-region-constraints.rs:17:56
2+
--> $DIR/implied-region-constraints.rs:21:56
33
|
44
LL | fn _bad_st<'a, 'b, T>(x: St<'a, 'b, T>)
55
| -- -- lifetime `'b` defined here
@@ -12,7 +12,7 @@ LL | let _failure_proves_not_implied_outlives_region_b: &'b T = &x.f0;
1212
= help: consider adding the following bound: `'a: 'b`
1313

1414
error: lifetime may not live long enough
15-
--> $DIR/implied-region-constraints.rs:38:64
15+
--> $DIR/implied-region-constraints.rs:43:64
1616
|
1717
LL | fn _bad_en7<'a, 'b, T>(x: En7<'a, 'b, T>)
1818
| -- -- lifetime `'b` defined here

src/test/ui/associated-type-bounds/implied-region-constraints.rs

Lines changed: 8 additions & 2 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
#![feature(associated_type_bounds)]
26

37
trait Tr1 { type As1; }
@@ -15,7 +19,8 @@ where
1519
{
1620
// This should fail because `T: 'b` is not implied from `WF(St<'a, 'b, T>)`.
1721
let _failure_proves_not_implied_outlives_region_b: &'b T = &x.f0;
18-
//~^ ERROR lifetime mismatch [E0623]
22+
//[base]~^ ERROR lifetime mismatch [E0623]
23+
//[nll]~^^ ERROR lifetime may not live long enough
1924
}
2025

2126
enum En7<'a, 'b, T> // `<T::As1 as Tr2>::As2: 'a` is implied.
@@ -36,7 +41,8 @@ where
3641
En7::V0(x) => {
3742
// Also fails for the same reason as above:
3843
let _failure_proves_not_implied_outlives_region_b: &'b T = &x;
39-
//~^ ERROR lifetime mismatch [E0623]
44+
//[base]~^ ERROR lifetime mismatch [E0623]
45+
//[nll]~^^ ERROR lifetime may not live long enough
4046
},
4147
En7::V1(_) => {},
4248
}

src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr renamed to src/test/ui/closure-expected-type/expect-fn-supply-fn.base.stderr

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
error[E0308]: mismatched types
2-
--> $DIR/expect-fn-supply-fn.rs:16:52
2+
--> $DIR/expect-fn-supply-fn.rs:20:52
33
|
44
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
55
| ^^^^^^^^^^^ lifetime mismatch
66
|
77
= note: expected fn pointer `fn(&u32)`
88
found fn pointer `fn(&'x u32)`
99
note: the anonymous lifetime #1 defined here...
10-
--> $DIR/expect-fn-supply-fn.rs:16:48
10+
--> $DIR/expect-fn-supply-fn.rs:20:48
1111
|
1212
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
1313
| ^^^^^^^^^^^^^^^^^^^^^^
1414
note: ...does not necessarily outlive the lifetime `'x` as defined here
15-
--> $DIR/expect-fn-supply-fn.rs:13:36
15+
--> $DIR/expect-fn-supply-fn.rs:17:36
1616
|
1717
LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
1818
| ^^
1919

2020
error[E0308]: mismatched types
21-
--> $DIR/expect-fn-supply-fn.rs:16:52
21+
--> $DIR/expect-fn-supply-fn.rs:20:52
2222
|
2323
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
2424
| ^^^^^^^^^^^ lifetime mismatch
2525
|
2626
= note: expected fn pointer `fn(&u32)`
2727
found fn pointer `fn(&'x u32)`
2828
note: the lifetime `'x` as defined here...
29-
--> $DIR/expect-fn-supply-fn.rs:13:36
29+
--> $DIR/expect-fn-supply-fn.rs:17:36
3030
|
3131
LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
3232
| ^^
3333
note: ...does not necessarily outlive the anonymous lifetime #1 defined here
34-
--> $DIR/expect-fn-supply-fn.rs:16:48
34+
--> $DIR/expect-fn-supply-fn.rs:20:48
3535
|
3636
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
3737
| ^^^^^^^^^^^^^^^^^^^^^^
3838

3939
error[E0308]: mismatched types
40-
--> $DIR/expect-fn-supply-fn.rs:32:52
40+
--> $DIR/expect-fn-supply-fn.rs:38:52
4141
|
4242
LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
4343
| ^^^^^^^^ one type is more general than the other
@@ -46,7 +46,7 @@ LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
4646
found fn pointer `for<'r> fn(&'r u32)`
4747

4848
error[E0308]: mismatched types
49-
--> $DIR/expect-fn-supply-fn.rs:39:53
49+
--> $DIR/expect-fn-supply-fn.rs:45:53
5050
|
5151
LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
5252
| ^^^^^^^^^^^ one type is more general than the other
@@ -55,7 +55,7 @@ LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
5555
found fn pointer `fn(&'x u32)`
5656

5757
error[E0308]: mismatched types
58-
--> $DIR/expect-fn-supply-fn.rs:48:53
58+
--> $DIR/expect-fn-supply-fn.rs:54:53
5959
|
6060
LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {
6161
| ^^^^^^^ one type is more general than the other

src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/expect-fn-supply-fn.rs:16:49
2+
--> $DIR/expect-fn-supply-fn.rs:20:49
33
|
44
LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
55
| -- lifetime `'x` defined here
@@ -11,7 +11,7 @@ LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
1111
| requires that `'1` must outlive `'x`
1212

1313
error: lifetime may not live long enough
14-
--> $DIR/expect-fn-supply-fn.rs:16:49
14+
--> $DIR/expect-fn-supply-fn.rs:20:49
1515
|
1616
LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
1717
| -- lifetime `'x` defined here
@@ -20,7 +20,7 @@ LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
2020
| ^ requires that `'x` must outlive `'static`
2121

2222
error[E0308]: mismatched types
23-
--> $DIR/expect-fn-supply-fn.rs:32:49
23+
--> $DIR/expect-fn-supply-fn.rs:38:49
2424
|
2525
LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
2626
| ^ one type is more general than the other
@@ -29,7 +29,7 @@ LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
2929
found fn pointer `fn(&u32)`
3030

3131
error[E0308]: mismatched types
32-
--> $DIR/expect-fn-supply-fn.rs:39:50
32+
--> $DIR/expect-fn-supply-fn.rs:45:50
3333
|
3434
LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
3535
| ^ one type is more general than the other
@@ -38,7 +38,7 @@ LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
3838
found fn pointer `for<'r> fn(&'r u32)`
3939

4040
error[E0308]: mismatched types
41-
--> $DIR/expect-fn-supply-fn.rs:48:50
41+
--> $DIR/expect-fn-supply-fn.rs:54:50
4242
|
4343
LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {
4444
| ^ one type is more general than the other

src/test/ui/closure-expected-type/expect-fn-supply-fn.rs

Lines changed: 8 additions & 2 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
fn with_closure_expecting_fn_with_free_region<F>(_: F)
26
where
37
F: for<'a> FnOnce(fn(&'a u32), &i32),
@@ -14,8 +18,10 @@ fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
1418
// Here, the type given for `'x` "obscures" a region from the
1519
// expected signature that is bound at closure level.
1620
with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
17-
//~^ ERROR mismatched types
18-
//~| ERROR mismatched types
21+
//[base]~^ ERROR mismatched types
22+
//[base]~| ERROR mismatched types
23+
//[nll]~^^^ ERROR lifetime may not live long enough
24+
//[nll]~| ERROR lifetime may not live long enough
1925
}
2026

2127
fn expect_free_supply_free_from_closure() {

src/test/ui/error-codes/E0490.stderr renamed to src/test/ui/error-codes/E0490.base.stderr

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,72 @@
11
error[E0490]: a value of type `&'b ()` is borrowed for too long
2-
--> $DIR/E0490.rs:2:20
2+
--> $DIR/E0490.rs:6:20
33
|
44
LL | let x: &'a _ = &y;
55
| ^^
66
|
77
note: the type is valid for the lifetime `'a` as defined here
8-
--> $DIR/E0490.rs:1:6
8+
--> $DIR/E0490.rs:5:6
99
|
1010
LL | fn f<'a, 'b>(y: &'b ()) {
1111
| ^^
1212
note: but the borrow lasts for the lifetime `'b` as defined here
13-
--> $DIR/E0490.rs:1:10
13+
--> $DIR/E0490.rs:5:10
1414
|
1515
LL | fn f<'a, 'b>(y: &'b ()) {
1616
| ^^
1717

1818
error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
19-
--> $DIR/E0490.rs:2:20
19+
--> $DIR/E0490.rs:6:20
2020
|
2121
LL | let x: &'a _ = &y;
2222
| ^^
2323
|
2424
note: first, the lifetime cannot outlive the lifetime `'b` as defined here...
25-
--> $DIR/E0490.rs:1:10
25+
--> $DIR/E0490.rs:5:10
2626
|
2727
LL | fn f<'a, 'b>(y: &'b ()) {
2828
| ^^
2929
note: ...so that the type `&'b ()` is not borrowed for too long
30-
--> $DIR/E0490.rs:2:20
30+
--> $DIR/E0490.rs:6:20
3131
|
3232
LL | let x: &'a _ = &y;
3333
| ^^
3434
note: but, the lifetime must be valid for the lifetime `'a` as defined here...
35-
--> $DIR/E0490.rs:1:6
35+
--> $DIR/E0490.rs:5:6
3636
|
3737
LL | fn f<'a, 'b>(y: &'b ()) {
3838
| ^^
3939
note: ...so that reference does not outlive borrowed content
40-
--> $DIR/E0490.rs:2:20
40+
--> $DIR/E0490.rs:6:20
4141
|
4242
LL | let x: &'a _ = &y;
4343
| ^^
4444

4545
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
46-
--> $DIR/E0490.rs:2:20
46+
--> $DIR/E0490.rs:6:20
4747
|
4848
LL | let x: &'a _ = &y;
4949
| ^^
5050
|
5151
note: first, the lifetime cannot outlive the lifetime `'b` as defined here...
52-
--> $DIR/E0490.rs:1:10
52+
--> $DIR/E0490.rs:5:10
5353
|
5454
LL | fn f<'a, 'b>(y: &'b ()) {
5555
| ^^
5656
note: ...so that the expression is assignable
57-
--> $DIR/E0490.rs:2:20
57+
--> $DIR/E0490.rs:6:20
5858
|
5959
LL | let x: &'a _ = &y;
6060
| ^^
6161
= note: expected `&'a &()`
6262
found `&'a &'b ()`
6363
note: but, the lifetime must be valid for the lifetime `'a` as defined here...
64-
--> $DIR/E0490.rs:1:6
64+
--> $DIR/E0490.rs:5:6
6565
|
6666
LL | fn f<'a, 'b>(y: &'b ()) {
6767
| ^^
6868
note: ...so that the reference type `&'a &()` does not outlive the data it points at
69-
--> $DIR/E0490.rs:2:12
69+
--> $DIR/E0490.rs:6:12
7070
|
7171
LL | let x: &'a _ = &y;
7272
| ^^^^^

src/test/ui/error-codes/E0490.nll.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/E0490.rs:2:12
2+
--> $DIR/E0490.rs:6:12
33
|
44
LL | fn f<'a, 'b>(y: &'b ()) {
55
| -- -- lifetime `'b` defined here
@@ -11,7 +11,7 @@ LL | let x: &'a _ = &y;
1111
= help: consider adding the following bound: `'b: 'a`
1212

1313
error[E0597]: `y` does not live long enough
14-
--> $DIR/E0490.rs:2:20
14+
--> $DIR/E0490.rs:6:20
1515
|
1616
LL | fn f<'a, 'b>(y: &'b ()) {
1717
| -- lifetime `'a` defined here

src/test/ui/error-codes/E0490.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
// revisions: base nll
2+
// ignore-compare-mode-nll
3+
//[nll] compile-flags: -Z borrowck=mir
4+
15
fn f<'a, 'b>(y: &'b ()) {
26
let x: &'a _ = &y;
3-
//~^ E0490
4-
//~| E0495
5-
//~| E0495
7+
//[base]~^ E0490
8+
//[base]~| E0495
9+
//[base]~| E0495
10+
//[nll]~^^^^ lifetime may not live long enough
11+
//[nll]~| E0597
612
}
713

814
fn main() {}

src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr renamed to src/test/ui/fn/implied-bounds-unnorm-associated-type.base.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0623]: lifetime mismatch
2-
--> $DIR/implied-bounds-unnorm-associated-type.rs:14:5
2+
--> $DIR/implied-bounds-unnorm-associated-type.rs:18:5
33
|
44
LL | fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str {
55
| ------- ----------

src/test/ui/fn/implied-bounds-unnorm-associated-type.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/implied-bounds-unnorm-associated-type.rs:14:5
2+
--> $DIR/implied-bounds-unnorm-associated-type.rs:18:5
33
|
44
LL | fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str {
55
| -- -- lifetime `'b` defined here

src/test/ui/fn/implied-bounds-unnorm-associated-type.rs

Lines changed: 7 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
// check-fail
26
// See issue #91068. Types in the substs of an associated type can't be implied
37
// to be WF, since they don't actually have to be constructed.
@@ -11,7 +15,9 @@ impl<T> Trait for T {
1115
}
1216

1317
fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str {
14-
s //~ ERROR lifetime mismatch [E0623]
18+
s
19+
//[base]~^ ERROR lifetime mismatch [E0623]
20+
//[nll]~^^ ERROR lifetime may not live long enough
1521
}
1622

1723
fn main() {

src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr renamed to src/test/ui/impl-header-lifetime-elision/dyn-trait.base.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
2-
--> $DIR/dyn-trait.rs:20:16
2+
--> $DIR/dyn-trait.rs:24:16
33
|
44
LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
55
| ------------------- this data with lifetime `'a`...
66
LL | static_val(x);
77
| ^ ...is used here...
88
|
99
note: ...and is required to live as long as `'static` here
10-
--> $DIR/dyn-trait.rs:20:5
10+
--> $DIR/dyn-trait.rs:24:5
1111
|
1212
LL | static_val(x);
1313
| ^^^^^^^^^^

src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0521]: borrowed data escapes outside of function
2-
--> $DIR/dyn-trait.rs:20:5
2+
--> $DIR/dyn-trait.rs:24:5
33
|
44
LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
55
| -- - `x` is a reference that is only valid in the function body

src/test/ui/impl-header-lifetime-elision/dyn-trait.rs

Lines changed: 7 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
// Test that `impl MyTrait<'_> for &i32` is equivalent to `impl<'a,
26
// 'b> MyTrait<'a> for &'b i32`.
37

@@ -17,7 +21,9 @@ fn static_val<T: StaticTrait>(_: T) {
1721
}
1822

1923
fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
20-
static_val(x); //~ ERROR E0759
24+
static_val(x);
25+
//[base]~^ ERROR E0759
26+
//[nll]~^^ ERROR borrowed data escapes outside of function
2127
}
2228

2329
fn not_static_val<T: NotStaticTrait>(_: T) {

0 commit comments

Comments
 (0)