about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorJack Huey <31162821+jackh726@users.noreply.github.com>2022-05-21 15:33:42 -0400
committerJack Huey <31162821+jackh726@users.noreply.github.com>2022-05-22 15:21:27 -0400
commit0fbb315be70aaaa19bd38801ad894657332f9fc3 (patch)
tree06da4477bc194e293e6d255be6f2ed18efeeb060 /src/test
parent62806f75369f810ddde1b28e6aca7b8a2792aac3 (diff)
downloadrust-0fbb315be70aaaa19bd38801ad894657332f9fc3.tar.gz
rust-0fbb315be70aaaa19bd38801ad894657332f9fc3.zip
Use revisions or ignore-compare-mode-nll for NLL in generic-associated-types
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/generic-associated-types/extended/lending_iterator.base.nll.stderr12
-rw-r--r--src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr6
-rw-r--r--src/test/ui/generic-associated-types/extended/lending_iterator.rs2
-rw-r--r--src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.base.stderr (renamed from src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr)6
-rw-r--r--src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.nll.stderr6
-rw-r--r--src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs13
-rw-r--r--src/test/ui/generic-associated-types/trait-objects.base.stderr4
-rw-r--r--src/test/ui/generic-associated-types/trait-objects.extended.nll.stderr17
-rw-r--r--src/test/ui/generic-associated-types/trait-objects.extended.stderr2
-rw-r--r--src/test/ui/generic-associated-types/trait-objects.rs2
10 files changed, 26 insertions, 44 deletions
diff --git a/src/test/ui/generic-associated-types/extended/lending_iterator.base.nll.stderr b/src/test/ui/generic-associated-types/extended/lending_iterator.base.nll.stderr
deleted file mode 100644
index 3da7794b3d2..00000000000
--- a/src/test/ui/generic-associated-types/extended/lending_iterator.base.nll.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0276]: impl has stricter requirements than trait
-  --> $DIR/lending_iterator.rs:14:45
-   |
-LL |     fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self;
-   |     ------------------------------------------------------------------------ definition of `from_iter` from trait
-...
-LL |     fn from_iter<I: for<'x> LendingIterator<Item<'x> = A>>(mut iter: I) -> Self {
-   |                                             ^^^^^^^^^^^^ impl has extra requirement `I: 'x`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0276`.
diff --git a/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr b/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr
index c5588b0912b..aa1e50014fe 100644
--- a/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr
+++ b/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr
@@ -1,5 +1,5 @@
 error[E0276]: impl has stricter requirements than trait
-  --> $DIR/lending_iterator.rs:14:45
+  --> $DIR/lending_iterator.rs:16:45
    |
 LL |     fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self;
    |     ------------------------------------------------------------------------ definition of `from_iter` from trait
@@ -8,7 +8,7 @@ LL |     fn from_iter<I: for<'x> LendingIterator<Item<'x> = A>>(mut iter: I) ->
    |                                             ^^^^^^^^^^^^ impl has extra requirement `I: 'x`
 
 error[E0311]: the parameter type `Self` may not live long enough
-  --> $DIR/lending_iterator.rs:35:9
+  --> $DIR/lending_iterator.rs:37:9
    |
 LL |         <B as FromLendingIterator<A>>::from_iter(self)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -16,7 +16,7 @@ LL |         <B as FromLendingIterator<A>>::from_iter(self)
    = help: consider adding an explicit lifetime bound `Self: 'a`...
    = note: ...so that the type `Self` will meet its required lifetime bounds...
 note: ...that is required by this bound
-  --> $DIR/lending_iterator.rs:10:45
+  --> $DIR/lending_iterator.rs:12:45
    |
 LL |     fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self;
    |                                             ^^^^^^^^^^^^
diff --git a/src/test/ui/generic-associated-types/extended/lending_iterator.rs b/src/test/ui/generic-associated-types/extended/lending_iterator.rs
index df11ab21249..6048e6e87c0 100644
--- a/src/test/ui/generic-associated-types/extended/lending_iterator.rs
+++ b/src/test/ui/generic-associated-types/extended/lending_iterator.rs
@@ -1,3 +1,5 @@
+// FIXME(nll): this is experimental anyways, don't really care about the output
+// ignore-compare-mode-nll
 // revisions: base extended
 //[base] check-fail
 //[extended] check-pass
diff --git a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.base.stderr
index 32c5ccf1648..341e2e05d1c 100644
--- a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr
+++ b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.base.stderr
@@ -1,5 +1,5 @@
 error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/projection-type-lifetime-mismatch.rs:17:7
+  --> $DIR/projection-type-lifetime-mismatch.rs:21:7
    |
 LL | fn f(x: &impl for<'a> X<Y<'a> = &'a ()>) -> &'static () {
    |         ------------------------------- this data with an anonymous lifetime `'_`...
@@ -9,7 +9,7 @@ LL |     x.m()
    |     ...is used and required to live as long as `'static` here
 
 error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/projection-type-lifetime-mismatch.rs:22:7
+  --> $DIR/projection-type-lifetime-mismatch.rs:27:7
    |
 LL | fn g<T: for<'a> X<Y<'a> = &'a ()>>(x: &T) -> &'static () {
    |                                       -- this data with an anonymous lifetime `'_`...
@@ -19,7 +19,7 @@ LL |     x.m()
    |     ...is used and required to live as long as `'static` here
 
 error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
-  --> $DIR/projection-type-lifetime-mismatch.rs:27:7
+  --> $DIR/projection-type-lifetime-mismatch.rs:33:7
    |
 LL | fn h(x: &()) -> &'static () {
    |         --- this data with an anonymous lifetime `'_`...
diff --git a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.nll.stderr b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.nll.stderr
index 4620aa34e84..00395af4889 100644
--- a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.nll.stderr
+++ b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.nll.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/projection-type-lifetime-mismatch.rs:17:5
+  --> $DIR/projection-type-lifetime-mismatch.rs:21:5
    |
 LL | fn f(x: &impl for<'a> X<Y<'a> = &'a ()>) -> &'static () {
    |         - let's call the lifetime of this reference `'1`
@@ -7,7 +7,7 @@ LL |     x.m()
    |     ^^^^^ returning this value requires that `'1` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/projection-type-lifetime-mismatch.rs:22:5
+  --> $DIR/projection-type-lifetime-mismatch.rs:27:5
    |
 LL | fn g<T: for<'a> X<Y<'a> = &'a ()>>(x: &T) -> &'static () {
    |                                       - let's call the lifetime of this reference `'1`
@@ -15,7 +15,7 @@ LL |     x.m()
    |     ^^^^^ returning this value requires that `'1` must outlive `'static`
 
 error: lifetime may not live long enough
-  --> $DIR/projection-type-lifetime-mismatch.rs:27:5
+  --> $DIR/projection-type-lifetime-mismatch.rs:33:5
    |
 LL | fn h(x: &()) -> &'static () {
    |         - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs
index 9b04fe23320..9f14c6f3dc0 100644
--- a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs
+++ b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs
@@ -1,3 +1,7 @@
+// ignore-compare-mode-nll
+// revisions: base nll
+// [nll]compile-flags: -Zborrowck=mir
+
 #![feature(generic_associated_types)]
 
 pub trait X {
@@ -15,17 +19,20 @@ impl X for () {
 
 fn f(x: &impl for<'a> X<Y<'a> = &'a ()>) -> &'static () {
     x.m()
-    //~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
+    //[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
+    //[nll]~^^ ERROR lifetime may not live long enough
 }
 
 fn g<T: for<'a> X<Y<'a> = &'a ()>>(x: &T) -> &'static () {
     x.m()
-    //~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
+    //[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
+    //[nll]~^^ ERROR lifetime may not live long enough
 }
 
 fn h(x: &()) -> &'static () {
     x.m()
-    //~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
+    //[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
+    //[nll]~^^ ERROR lifetime may not live long enough
 }
 
 fn main() {
diff --git a/src/test/ui/generic-associated-types/trait-objects.base.stderr b/src/test/ui/generic-associated-types/trait-objects.base.stderr
index 1df76a21bf9..eed12f56be2 100644
--- a/src/test/ui/generic-associated-types/trait-objects.base.stderr
+++ b/src/test/ui/generic-associated-types/trait-objects.base.stderr
@@ -1,11 +1,11 @@
 error[E0038]: the trait `StreamingIterator` cannot be made into an object
-  --> $DIR/trait-objects.rs:14:21
+  --> $DIR/trait-objects.rs:16:21
    |
 LL | fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize {
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `StreamingIterator` cannot be made into an object
    |
 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>
-  --> $DIR/trait-objects.rs:8:10
+  --> $DIR/trait-objects.rs:10:10
    |
 LL | trait StreamingIterator {
    |       ----------------- this trait cannot be made into an object...
diff --git a/src/test/ui/generic-associated-types/trait-objects.extended.nll.stderr b/src/test/ui/generic-associated-types/trait-objects.extended.nll.stderr
deleted file mode 100644
index 52d48d57859..00000000000
--- a/src/test/ui/generic-associated-types/trait-objects.extended.nll.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0521]: borrowed data escapes outside of function
-  --> $DIR/trait-objects.rs:16:5
-   |
-LL | fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize {
-   |             -  - let's call the lifetime of this reference `'1`
-   |             |
-   |             `x` is a reference that is only valid in the function body
-LL |
-LL |     x.size_hint().0
-   |     ^^^^^^^^^^^^^
-   |     |
-   |     `x` escapes the function body here
-   |     argument requires that `'1` must outlive `'static`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0521`.
diff --git a/src/test/ui/generic-associated-types/trait-objects.extended.stderr b/src/test/ui/generic-associated-types/trait-objects.extended.stderr
index 7cc3dad9921..c7b072256ad 100644
--- a/src/test/ui/generic-associated-types/trait-objects.extended.stderr
+++ b/src/test/ui/generic-associated-types/trait-objects.extended.stderr
@@ -1,5 +1,5 @@
 error[E0621]: explicit lifetime required in the type of `x`
-  --> $DIR/trait-objects.rs:16:7
+  --> $DIR/trait-objects.rs:18:7
    |
 LL | fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize {
    |                ------------------------------------------------------ help: add explicit lifetime `'a` to the type of `x`: `&'a mut (dyn StreamingIterator<for<'a> Item = &'a i32> + 'a)`
diff --git a/src/test/ui/generic-associated-types/trait-objects.rs b/src/test/ui/generic-associated-types/trait-objects.rs
index 644e56ce21f..d742d2051be 100644
--- a/src/test/ui/generic-associated-types/trait-objects.rs
+++ b/src/test/ui/generic-associated-types/trait-objects.rs
@@ -1,3 +1,5 @@
+// FIXME(nll): this is experimental anyways, don't really care about the output
+// ignore-compare-mode-nll
 // revisions: base extended
 
 #![feature(generic_associated_types)]