about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorAli MJ Al-Nasrawy <alimjalnasrawy@gmail.com>2023-12-11 13:03:35 +0000
committerAli MJ Al-Nasrawy <alimjalnasrawy@gmail.com>2023-12-17 07:31:07 +0000
commit9f7d0e91b528a19a9516df0f647a0191808e7227 (patch)
tree2ceb698fa753cce1808f0ef8573b60a26dd5a806 /tests
parent604f185fae9a4b0edf7e28f616a0f53880f8f074 (diff)
downloadrust-9f7d0e91b528a19a9516df0f647a0191808e7227.tar.gz
rust-9f7d0e91b528a19a9516df0f647a0191808e7227.zip
use Vec for region constraints
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/higher-ranked/higher-ranked-lifetime-error.stderr4
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.rs2
-rw-r--r--tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.stderr14
-rw-r--r--tests/ui/lifetimes/issue-79187-2.stderr18
4 files changed, 27 insertions, 11 deletions
diff --git a/tests/ui/higher-ranked/higher-ranked-lifetime-error.stderr b/tests/ui/higher-ranked/higher-ranked-lifetime-error.stderr
index d0892fd8b09..c25e731d962 100644
--- a/tests/ui/higher-ranked/higher-ranked-lifetime-error.stderr
+++ b/tests/ui/higher-ranked/higher-ranked-lifetime-error.stderr
@@ -4,8 +4,8 @@ error[E0308]: mismatched types
 LL |     assert_all::<_, &String>(id);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
    |
-   = note: expected reference `&String`
-              found reference `&String`
+   = note: expected trait `for<'a> <for<'a> fn(&'a String) -> &'a String {id} as FnMut<(&'a String,)>>`
+              found trait `for<'a> <for<'a> fn(&'a String) -> &'a String {id} as FnMut<(&'a String,)>>`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.rs b/tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.rs
index d45fa183c0c..07befeff43c 100644
--- a/tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.rs
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.rs
@@ -41,7 +41,7 @@ where
     // isize>`, we require `T : for<'a> Bar<&'a isize>`, but the where
     // clause only specifies `T : Bar<&'b isize>`.
     foo_hrtb_bar_not(&mut t);
-    //~^ ERROR implementation of `Bar` is not general enough
+    //~^ ERROR mismatched types
     //~^^ ERROR lifetime may not live long enough
 }
 
diff --git a/tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.stderr b/tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.stderr
index 727b9e6bec8..14a80630f40 100644
--- a/tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/hrtb-perfect-forwarding.stderr
@@ -53,14 +53,19 @@ note: due to current limitations in the borrow checker, this implies a `'static`
 LL |     T: for<'a> Foo<&'a isize> + Bar<&'b isize>,
    |        ^^^^^^^^^^^^^^^^^^^^^^
 
-error: implementation of `Bar` is not general enough
+error[E0308]: mismatched types
   --> $DIR/hrtb-perfect-forwarding.rs:43:5
    |
 LL |     foo_hrtb_bar_not(&mut t);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Bar` is not general enough
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
    |
-   = note: `T` must implement `Bar<&'0 isize>`, for any lifetime `'0`...
-   = note: ...but it actually implements `Bar<&'1 isize>`, for some specific lifetime `'1`
+   = note: expected trait `for<'a> <T as Foo<&'a isize>>`
+              found trait `for<'a> <T as Foo<&'a isize>>`
+note: the lifetime requirement is introduced here
+  --> $DIR/hrtb-perfect-forwarding.rs:37:8
+   |
+LL |     T: for<'a> Foo<&'a isize> + Bar<&'b isize>,
+   |        ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: function cannot return without recursing
   --> $DIR/hrtb-perfect-forwarding.rs:48:1
@@ -77,3 +82,4 @@ LL |       foo_hrtb_bar_hrtb(&mut t);
 
 error: aborting due to 2 previous errors; 4 warnings emitted
 
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/lifetimes/issue-79187-2.stderr b/tests/ui/lifetimes/issue-79187-2.stderr
index e8115bb6b06..0b7593f01c6 100644
--- a/tests/ui/lifetimes/issue-79187-2.stderr
+++ b/tests/ui/lifetimes/issue-79187-2.stderr
@@ -54,8 +54,13 @@ error[E0308]: mismatched types
 LL |     take_foo(|a: &i32| a);
    |     ^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
    |
-   = note: expected reference `&_`
-              found reference `&_`
+   = note: expected trait `for<'a> <{closure@$DIR/issue-79187-2.rs:11:14: 11:23} as FnOnce<(&'a i32,)>>`
+              found trait `for<'a> <{closure@$DIR/issue-79187-2.rs:11:14: 11:23} as FnOnce<(&'a i32,)>>`
+note: this closure does not fulfill the lifetime requirements
+  --> $DIR/issue-79187-2.rs:11:14
+   |
+LL |     take_foo(|a: &i32| a);
+   |              ^^^^^^^^^
 note: the lifetime requirement is introduced here
   --> $DIR/issue-79187-2.rs:5:21
    |
@@ -68,8 +73,13 @@ error[E0308]: mismatched types
 LL |     take_foo(|a: &i32| -> &i32 { a });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
    |
-   = note: expected reference `&_`
-              found reference `&_`
+   = note: expected trait `for<'a> <{closure@$DIR/issue-79187-2.rs:14:14: 14:31} as FnOnce<(&'a i32,)>>`
+              found trait `for<'a> <{closure@$DIR/issue-79187-2.rs:14:14: 14:31} as FnOnce<(&'a i32,)>>`
+note: this closure does not fulfill the lifetime requirements
+  --> $DIR/issue-79187-2.rs:14:14
+   |
+LL |     take_foo(|a: &i32| -> &i32 { a });
+   |              ^^^^^^^^^^^^^^^^^
 note: the lifetime requirement is introduced here
   --> $DIR/issue-79187-2.rs:5:21
    |