about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJack Huey <31162821+jackh726@users.noreply.github.com>2022-05-21 12:59:02 -0400
committerJack Huey <31162821+jackh726@users.noreply.github.com>2022-05-22 15:21:26 -0400
commit707d2ebb5be0512271ee7c2039d29d6f2c0e2f0e (patch)
tree4338fee20fe647cae6f413d4e828479ec8bd53fb
parentdc435ee762b0f46dba84e67798c8a2f0ab394091 (diff)
downloadrust-707d2ebb5be0512271ee7c2039d29d6f2c0e2f0e.tar.gz
rust-707d2ebb5be0512271ee7c2039d29d6f2c0e2f0e.zip
Use revisions for NLL (consistently) in higher-ranked-trait-bounds
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-59311.base.stderr (renamed from src/test/ui/higher-rank-trait-bounds/issue-59311.stderr)4
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-59311.nll.stderr6
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-59311.rs9
-rw-r--r--src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.base.stderr20
-rw-r--r--src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.nll.stderr24
-rw-r--r--src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.rs13
6 files changed, 49 insertions, 27 deletions
diff --git a/src/test/ui/higher-rank-trait-bounds/issue-59311.stderr b/src/test/ui/higher-rank-trait-bounds/issue-59311.base.stderr
index 3dd05bba5c0..ec576ee529a 100644
--- a/src/test/ui/higher-rank-trait-bounds/issue-59311.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/issue-59311.base.stderr
@@ -1,11 +1,11 @@
 error[E0477]: the type `&'a V` does not fulfill the required lifetime
-  --> $DIR/issue-59311.rs:17:5
+  --> $DIR/issue-59311.rs:21:5
    |
 LL |     v.t(|| {});
    |     ^^^^^^^^^^
    |
 note: type must satisfy the static lifetime as required by this binding
-  --> $DIR/issue-59311.rs:15:24
+  --> $DIR/issue-59311.rs:19:24
    |
 LL |     for<'a> &'a V: T + 'static,
    |                        ^^^^^^^
diff --git a/src/test/ui/higher-rank-trait-bounds/issue-59311.nll.stderr b/src/test/ui/higher-rank-trait-bounds/issue-59311.nll.stderr
index 15e83ab5a34..7f98cefdf01 100644
--- a/src/test/ui/higher-rank-trait-bounds/issue-59311.nll.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/issue-59311.nll.stderr
@@ -1,13 +1,13 @@
 error: higher-ranked lifetime error
-  --> $DIR/issue-59311.rs:17:5
+  --> $DIR/issue-59311.rs:21:5
    |
 LL |     v.t(|| {});
    |     ^^^^^^^^^^
    |
-   = note: could not prove [closure@$DIR/issue-59311.rs:17:9: 17:14] well-formed
+   = note: could not prove [closure@$DIR/issue-59311.rs:21:9: 21:14] well-formed
 
 error: higher-ranked lifetime error
-  --> $DIR/issue-59311.rs:17:9
+  --> $DIR/issue-59311.rs:21:9
    |
 LL |     v.t(|| {});
    |         ^^^^^
diff --git a/src/test/ui/higher-rank-trait-bounds/issue-59311.rs b/src/test/ui/higher-rank-trait-bounds/issue-59311.rs
index 69708577285..a63c5754f8f 100644
--- a/src/test/ui/higher-rank-trait-bounds/issue-59311.rs
+++ b/src/test/ui/higher-rank-trait-bounds/issue-59311.rs
@@ -6,6 +6,10 @@
 // an error, but the regression test is here to ensure
 // that it does not ICE. See discussion on #74889 for details.
 
+// revisions: base nll
+// ignore-compare-mode-nll
+//[nll] compile-flags: -Z borrowck=mir
+
 pub trait T {
     fn t<F: Fn()>(&self, _: F) {}
 }
@@ -14,7 +18,10 @@ pub fn crash<V>(v: &V)
 where
     for<'a> &'a V: T + 'static,
 {
-    v.t(|| {}); //~ ERROR: `&'a V` does not fulfill the required lifetime
+    v.t(|| {});
+    //[base]~^ ERROR: `&'a V` does not fulfill the required lifetime
+    //[nll]~^^ ERROR: higher-ranked lifetime error
+    //[nll]~| ERROR: higher-ranked lifetime error
 }
 
 fn main() {}
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.base.stderr b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.base.stderr
new file mode 100644
index 00000000000..c24afdd418b
--- /dev/null
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.base.stderr
@@ -0,0 +1,20 @@
+error: implementation of `Parser` is not general enough
+  --> $DIR/issue-71955.rs:49:5
+   |
+LL |     foo(bar, "string", |s| s.len() == 5);
+   |     ^^^ implementation of `Parser` is not general enough
+   |
+   = note: `for<'a> fn(&'a str) -> (&'a str, &'a str) {bar}` must implement `Parser<'0>`, for any lifetime `'0`...
+   = note: ...but it actually implements `Parser<'1>`, for some specific lifetime `'1`
+
+error: implementation of `Parser` is not general enough
+  --> $DIR/issue-71955.rs:53:5
+   |
+LL |     foo(baz, "string", |s| s.0.len() == 5);
+   |     ^^^ implementation of `Parser` is not general enough
+   |
+   = note: `for<'a> fn(&'a str) -> (&'a str, Wrapper<'a>) {baz}` must implement `Parser<'0>`, for any lifetime `'0`...
+   = note: ...but it actually implements `Parser<'1>`, for some specific lifetime `'1`
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.nll.stderr b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.nll.stderr
index 0f38f8e3283..9d3cd4dee53 100644
--- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.nll.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.nll.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-71955.rs:54:5
+  --> $DIR/issue-71955.rs:49:5
    |
 LL |     foo(bar, "string", |s| s.len() == 5);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
@@ -7,18 +7,18 @@ LL |     foo(bar, "string", |s| s.len() == 5);
    = note: expected type `for<'r, 's> FnOnce<(&'r &'s str,)>`
               found type `for<'r> FnOnce<(&'r &str,)>`
 note: this closure does not fulfill the lifetime requirements
-  --> $DIR/issue-71955.rs:54:24
+  --> $DIR/issue-71955.rs:49:24
    |
 LL |     foo(bar, "string", |s| s.len() == 5);
    |                        ^^^^^^^^^^^^^^^^
 note: the lifetime requirement is introduced here
-  --> $DIR/issue-71955.rs:34:9
+  --> $DIR/issue-71955.rs:29:9
    |
 LL |     F2: FnOnce(&<F1 as Parser>::Output) -> bool
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/issue-71955.rs:54:5
+  --> $DIR/issue-71955.rs:49:5
    |
 LL |     foo(bar, "string", |s| s.len() == 5);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
@@ -26,18 +26,18 @@ LL |     foo(bar, "string", |s| s.len() == 5);
    = note: expected type `FnOnce<(&&str,)>`
               found type `for<'r> FnOnce<(&'r &str,)>`
 note: this closure does not fulfill the lifetime requirements
-  --> $DIR/issue-71955.rs:54:24
+  --> $DIR/issue-71955.rs:49:24
    |
 LL |     foo(bar, "string", |s| s.len() == 5);
    |                        ^^^^^^^^^^^^^^^^
 note: the lifetime requirement is introduced here
-  --> $DIR/issue-71955.rs:34:44
+  --> $DIR/issue-71955.rs:29:44
    |
 LL |     F2: FnOnce(&<F1 as Parser>::Output) -> bool
    |                                            ^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/issue-71955.rs:58:5
+  --> $DIR/issue-71955.rs:53:5
    |
 LL |     foo(baz, "string", |s| s.0.len() == 5);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
@@ -45,18 +45,18 @@ LL |     foo(baz, "string", |s| s.0.len() == 5);
    = note: expected type `for<'r, 's> FnOnce<(&'r Wrapper<'s>,)>`
               found type `for<'r> FnOnce<(&'r Wrapper<'_>,)>`
 note: this closure does not fulfill the lifetime requirements
-  --> $DIR/issue-71955.rs:58:24
+  --> $DIR/issue-71955.rs:53:24
    |
 LL |     foo(baz, "string", |s| s.0.len() == 5);
    |                        ^^^^^^^^^^^^^^^^^^
 note: the lifetime requirement is introduced here
-  --> $DIR/issue-71955.rs:34:9
+  --> $DIR/issue-71955.rs:29:9
    |
 LL |     F2: FnOnce(&<F1 as Parser>::Output) -> bool
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/issue-71955.rs:58:5
+  --> $DIR/issue-71955.rs:53:5
    |
 LL |     foo(baz, "string", |s| s.0.len() == 5);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
@@ -64,12 +64,12 @@ LL |     foo(baz, "string", |s| s.0.len() == 5);
    = note: expected type `FnOnce<(&Wrapper<'_>,)>`
               found type `for<'r> FnOnce<(&'r Wrapper<'_>,)>`
 note: this closure does not fulfill the lifetime requirements
-  --> $DIR/issue-71955.rs:58:24
+  --> $DIR/issue-71955.rs:53:24
    |
 LL |     foo(baz, "string", |s| s.0.len() == 5);
    |                        ^^^^^^^^^^^^^^^^^^
 note: the lifetime requirement is introduced here
-  --> $DIR/issue-71955.rs:34:44
+  --> $DIR/issue-71955.rs:29:44
    |
 LL |     F2: FnOnce(&<F1 as Parser>::Output) -> bool
    |                                            ^^^^
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.rs b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.rs
index 4b7e207b96d..8d283afd09d 100644
--- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.rs
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.rs
@@ -1,13 +1,8 @@
 // ignore-compare-mode-nll
-// revisions: migrate nll
+// revisions: base nll
 // [nll]compile-flags: -Zborrowck=mir
-// check-fail
-
-// Since we are testing nll (and migration) explicitly as a separate
-// revisions, don't worry about the --compare-mode=nll on this test.
-
-// ignore-compare-mode-nll
 
+// check-fail
 #![feature(rustc_attrs)]
 
 trait Parser<'s> {
@@ -52,11 +47,11 @@ fn main() {
     }
 
     foo(bar, "string", |s| s.len() == 5);
-    //[migrate]~^ ERROR implementation of `Parser` is not general enough
+    //[base]~^ ERROR implementation of `Parser` is not general enough
     //[nll]~^^ ERROR mismatched types
     //[nll]~| ERROR mismatched types
     foo(baz, "string", |s| s.0.len() == 5);
-    //[migrate]~^ ERROR implementation of `Parser` is not general enough
+    //[base]~^ ERROR implementation of `Parser` is not general enough
     //[nll]~^^ ERROR mismatched types
     //[nll]~| ERROR mismatched types
 }