Skip to content

Commit b7c192e

Browse files
committed
Use revisions for NLL in hrtb
1 parent b16bd7c commit b7c192e

21 files changed

+95
-71
lines changed

src/test/ui/hrtb/hrtb-conflate-regions.stderr renamed to src/test/ui/hrtb/hrtb-conflate-regions.base.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: implementation of `Foo` is not general enough
2-
--> $DIR/hrtb-conflate-regions.rs:27:10
2+
--> $DIR/hrtb-conflate-regions.rs:31:10
33
|
44
LL | fn b() { want_foo2::<SomeStruct>(); }
55
| ^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough

src/test/ui/hrtb/hrtb-conflate-regions.nll.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: implementation of `Foo` is not general enough
2-
--> $DIR/hrtb-conflate-regions.rs:27:10
2+
--> $DIR/hrtb-conflate-regions.rs:31:10
33
|
44
LL | fn b() { want_foo2::<SomeStruct>(); }
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
@@ -8,7 +8,7 @@ LL | fn b() { want_foo2::<SomeStruct>(); }
88
= note: ...but it actually implements `Foo<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
99

1010
error: implementation of `Foo` is not general enough
11-
--> $DIR/hrtb-conflate-regions.rs:27:10
11+
--> $DIR/hrtb-conflate-regions.rs:31:10
1212
|
1313
LL | fn b() { want_foo2::<SomeStruct>(); }
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough

src/test/ui/hrtb/hrtb-conflate-regions.rs

Lines changed: 8 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 an impl with only one bound region `'a` cannot be used to
26
// satisfy a constraint where there are two bound regions.
37

@@ -24,6 +28,9 @@ impl<'a> Foo<(&'a isize, &'a isize)> for SomeStruct
2428
}
2529

2630
fn a() { want_foo1::<SomeStruct>(); } // OK -- foo wants just one region
27-
fn b() { want_foo2::<SomeStruct>(); } //~ ERROR
31+
fn b() { want_foo2::<SomeStruct>(); }
32+
//[base]~^ ERROR
33+
//[nll]~^^ ERROR implementation of
34+
//[nll]~| ERROR implementation of
2835

2936
fn main() { }

src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr renamed to src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.base.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: implementation of `Trait` is not general enough
2-
--> $DIR/hrtb-exists-forall-trait-contravariant.rs:34:5
2+
--> $DIR/hrtb-exists-forall-trait-contravariant.rs:38:5
33
|
44
LL | foo::<()>();
55
| ^^^^^^^^^ implementation of `Trait` is not general enough

src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: implementation of `Trait` is not general enough
2-
--> $DIR/hrtb-exists-forall-trait-contravariant.rs:34:5
2+
--> $DIR/hrtb-exists-forall-trait-contravariant.rs:38:5
33
|
44
LL | foo::<()>();
55
| ^^^^^^^^^^^ implementation of `Trait` is not general enough

src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.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 a case where variance and higher-ranked types interact in surprising ways.
26
//
37
// In particular, we test this pattern in trait solving, where it is not connected

src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr renamed to src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.base.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: implementation of `Trait` is not general enough
2-
--> $DIR/hrtb-exists-forall-trait-invariant.rs:28:5
2+
--> $DIR/hrtb-exists-forall-trait-invariant.rs:32:5
33
|
44
LL | foo::<()>();
55
| ^^^^^^^^^ implementation of `Trait` is not general enough

src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: implementation of `Trait` is not general enough
2-
--> $DIR/hrtb-exists-forall-trait-invariant.rs:28:5
2+
--> $DIR/hrtb-exists-forall-trait-invariant.rs:32:5
33
|
44
LL | foo::<()>();
55
| ^^^^^^^^^^^ implementation of `Trait` is not general enough

src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.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 an `exists<'a> { forall<'b> { 'a = 'b } }` pattern -- which should not compile!
26
//
37
// In particular, we test this pattern in trait solving, where it is not connected

src/test/ui/hrtb/hrtb-just-for-static.stderr renamed to src/test/ui/hrtb/hrtb-just-for-static.base.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: implementation of `Foo` is not general enough
2-
--> $DIR/hrtb-just-for-static.rs:24:5
2+
--> $DIR/hrtb-just-for-static.rs:28:5
33
|
44
LL | want_hrtb::<StaticInt>()
55
| ^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
@@ -8,7 +8,7 @@ LL | want_hrtb::<StaticInt>()
88
= note: ...but it actually implements `Foo<&'static isize>`
99

1010
error: implementation of `Foo` is not general enough
11-
--> $DIR/hrtb-just-for-static.rs:30:5
11+
--> $DIR/hrtb-just-for-static.rs:34:5
1212
|
1313
LL | want_hrtb::<&'a u32>()
1414
| ^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough

0 commit comments

Comments
 (0)