Skip to content

Commit 0fbb315

Browse files
committed
Use revisions or ignore-compare-mode-nll for NLL in generic-associated-types
1 parent 62806f7 commit 0fbb315

10 files changed

+26
-44
lines changed

src/test/ui/generic-associated-types/extended/lending_iterator.base.nll.stderr

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

src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0276]: impl has stricter requirements than trait
2-
--> $DIR/lending_iterator.rs:14:45
2+
--> $DIR/lending_iterator.rs:16:45
33
|
44
LL | fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self;
55
| ------------------------------------------------------------------------ definition of `from_iter` from trait
@@ -8,15 +8,15 @@ LL | fn from_iter<I: for<'x> LendingIterator<Item<'x> = A>>(mut iter: I) ->
88
| ^^^^^^^^^^^^ impl has extra requirement `I: 'x`
99

1010
error[E0311]: the parameter type `Self` may not live long enough
11-
--> $DIR/lending_iterator.rs:35:9
11+
--> $DIR/lending_iterator.rs:37:9
1212
|
1313
LL | <B as FromLendingIterator<A>>::from_iter(self)
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1515
|
1616
= help: consider adding an explicit lifetime bound `Self: 'a`...
1717
= note: ...so that the type `Self` will meet its required lifetime bounds...
1818
note: ...that is required by this bound
19-
--> $DIR/lending_iterator.rs:10:45
19+
--> $DIR/lending_iterator.rs:12:45
2020
|
2121
LL | fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self;
2222
| ^^^^^^^^^^^^

src/test/ui/generic-associated-types/extended/lending_iterator.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// FIXME(nll): this is experimental anyways, don't really care about the output
2+
// ignore-compare-mode-nll
13
// revisions: base extended
24
//[base] check-fail
35
//[extended] check-pass

src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr renamed to src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.base.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
2-
--> $DIR/projection-type-lifetime-mismatch.rs:17:7
2+
--> $DIR/projection-type-lifetime-mismatch.rs:21:7
33
|
44
LL | fn f(x: &impl for<'a> X<Y<'a> = &'a ()>) -> &'static () {
55
| ------------------------------- this data with an anonymous lifetime `'_`...
@@ -9,7 +9,7 @@ LL | x.m()
99
| ...is used and required to live as long as `'static` here
1010

1111
error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
12-
--> $DIR/projection-type-lifetime-mismatch.rs:22:7
12+
--> $DIR/projection-type-lifetime-mismatch.rs:27:7
1313
|
1414
LL | fn g<T: for<'a> X<Y<'a> = &'a ()>>(x: &T) -> &'static () {
1515
| -- this data with an anonymous lifetime `'_`...
@@ -19,7 +19,7 @@ LL | x.m()
1919
| ...is used and required to live as long as `'static` here
2020

2121
error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
22-
--> $DIR/projection-type-lifetime-mismatch.rs:27:7
22+
--> $DIR/projection-type-lifetime-mismatch.rs:33:7
2323
|
2424
LL | fn h(x: &()) -> &'static () {
2525
| --- this data with an anonymous lifetime `'_`...

src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.nll.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
error: lifetime may not live long enough
2-
--> $DIR/projection-type-lifetime-mismatch.rs:17:5
2+
--> $DIR/projection-type-lifetime-mismatch.rs:21:5
33
|
44
LL | fn f(x: &impl for<'a> X<Y<'a> = &'a ()>) -> &'static () {
55
| - let's call the lifetime of this reference `'1`
66
LL | x.m()
77
| ^^^^^ returning this value requires that `'1` must outlive `'static`
88

99
error: lifetime may not live long enough
10-
--> $DIR/projection-type-lifetime-mismatch.rs:22:5
10+
--> $DIR/projection-type-lifetime-mismatch.rs:27:5
1111
|
1212
LL | fn g<T: for<'a> X<Y<'a> = &'a ()>>(x: &T) -> &'static () {
1313
| - let's call the lifetime of this reference `'1`
1414
LL | x.m()
1515
| ^^^^^ returning this value requires that `'1` must outlive `'static`
1616

1717
error: lifetime may not live long enough
18-
--> $DIR/projection-type-lifetime-mismatch.rs:27:5
18+
--> $DIR/projection-type-lifetime-mismatch.rs:33:5
1919
|
2020
LL | fn h(x: &()) -> &'static () {
2121
| - let's call the lifetime of this reference `'1`

src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs

Lines changed: 10 additions & 3 deletions
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
#![feature(generic_associated_types)]
26

37
pub trait X {
@@ -15,17 +19,20 @@ impl X for () {
1519

1620
fn f(x: &impl for<'a> X<Y<'a> = &'a ()>) -> &'static () {
1721
x.m()
18-
//~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
22+
//[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
23+
//[nll]~^^ ERROR lifetime may not live long enough
1924
}
2025

2126
fn g<T: for<'a> X<Y<'a> = &'a ()>>(x: &T) -> &'static () {
2227
x.m()
23-
//~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
28+
//[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
29+
//[nll]~^^ ERROR lifetime may not live long enough
2430
}
2531

2632
fn h(x: &()) -> &'static () {
2733
x.m()
28-
//~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
34+
//[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
35+
//[nll]~^^ ERROR lifetime may not live long enough
2936
}
3037

3138
fn main() {

src/test/ui/generic-associated-types/trait-objects.base.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0038]: the trait `StreamingIterator` cannot be made into an object
2-
--> $DIR/trait-objects.rs:14:21
2+
--> $DIR/trait-objects.rs:16:21
33
|
44
LL | fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `StreamingIterator` cannot be made into an object
66
|
77
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
8-
--> $DIR/trait-objects.rs:8:10
8+
--> $DIR/trait-objects.rs:10:10
99
|
1010
LL | trait StreamingIterator {
1111
| ----------------- this trait cannot be made into an object...

src/test/ui/generic-associated-types/trait-objects.extended.nll.stderr

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

src/test/ui/generic-associated-types/trait-objects.extended.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0621]: explicit lifetime required in the type of `x`
2-
--> $DIR/trait-objects.rs:16:7
2+
--> $DIR/trait-objects.rs:18:7
33
|
44
LL | fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize {
55
| ------------------------------------------------------ help: add explicit lifetime `'a` to the type of `x`: `&'a mut (dyn StreamingIterator<for<'a> Item = &'a i32> + 'a)`

src/test/ui/generic-associated-types/trait-objects.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// FIXME(nll): this is experimental anyways, don't really care about the output
2+
// ignore-compare-mode-nll
13
// revisions: base extended
24

35
#![feature(generic_associated_types)]

0 commit comments

Comments
 (0)