summaryrefslogtreecommitdiffstats
path: root/src/test/ui/regions
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/regions')
-rw-r--r--src/test/ui/regions/issue-102374.rs1
-rw-r--r--src/test/ui/regions/issue-102374.stderr5
-rw-r--r--src/test/ui/regions/issue-11612.rs24
-rw-r--r--src/test/ui/regions/regions-free-region-ordering-caller1.stderr2
-rw-r--r--src/test/ui/regions/regions-var-type-out-of-scope.stderr2
5 files changed, 30 insertions, 4 deletions
diff --git a/src/test/ui/regions/issue-102374.rs b/src/test/ui/regions/issue-102374.rs
index e0a116421..fd71248d9 100644
--- a/src/test/ui/regions/issue-102374.rs
+++ b/src/test/ui/regions/issue-102374.rs
@@ -1,3 +1,4 @@
+// normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
use std::cell::Cell;
#[rustfmt::skip]
diff --git a/src/test/ui/regions/issue-102374.stderr b/src/test/ui/regions/issue-102374.stderr
index 31b855c36..157850693 100644
--- a/src/test/ui/regions/issue-102374.stderr
+++ b/src/test/ui/regions/issue-102374.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/issue-102374.rs:16:5
+ --> $DIR/issue-102374.rs:17:5
|
LL | ) -> i32 {
| --- expected `i32` because of return type
@@ -7,7 +7,8 @@ LL | f
| ^ expected `i32`, found fn pointer
|
= note: expected type `i32`
- found fn pointer `for<'z1, 'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p, 'q, 'r, 's, 't, 'u, 'v, 'w, 'x, 'y, 'z, 'z0> fn(Cell<(&'z1 i32, &'a i32, &'b i32, &'c i32, &'d i32, &'e i32, &'f i32, &'g i32, &'h i32, &'i i32, &'j i32, &'k i32, &'l i32, &'m i32, &'n i32, &'o i32, &'p i32, &'q i32, &'r i32, &'s i32, &'t i32, &'u i32, &'v i32, &'w i32, &'x i32, &'y i32, &'z i32, &'z0 i32)>)`
+ found fn pointer `for<'z1, 'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p, 'q, 'r, 's, 't, 'u, 'v, 'w, 'x, 'y, 'z, 'z0> fn(Cell<...>)`
+ the full type name has been written to '$TEST_BUILD_DIR/regions/issue-102374/issue-102374.long-type-hash.txt'
error: aborting due to previous error
diff --git a/src/test/ui/regions/issue-11612.rs b/src/test/ui/regions/issue-11612.rs
new file mode 100644
index 000000000..9f7f1cc6f
--- /dev/null
+++ b/src/test/ui/regions/issue-11612.rs
@@ -0,0 +1,24 @@
+// check-pass
+#![allow(dead_code)]
+// #11612
+// We weren't updating the auto adjustments with all the resolved
+// type information after type check.
+
+// pretty-expanded FIXME #23616
+
+trait A { fn dummy(&self) { } }
+
+struct B<'a, T:'a> {
+ f: &'a T
+}
+
+impl<'a, T> A for B<'a, T> {}
+
+fn foo(_: &dyn A) {}
+
+fn bar<G>(b: &B<G>) {
+ foo(b); // Coercion should work
+ foo(b as &dyn A); // Explicit cast should work as well
+}
+
+fn main() {}
diff --git a/src/test/ui/regions/regions-free-region-ordering-caller1.stderr b/src/test/ui/regions/regions-free-region-ordering-caller1.stderr
index 8042b1740..8ef7e2253 100644
--- a/src/test/ui/regions/regions-free-region-ordering-caller1.stderr
+++ b/src/test/ui/regions/regions-free-region-ordering-caller1.stderr
@@ -5,7 +5,7 @@ LL | fn call1<'a>(x: &'a usize) {
| -- lifetime `'a` defined here
...
LL | let z: &'a & usize = &(&y);
- | ----------- ^^^^ creates a temporary which is freed while still in use
+ | ----------- ^^^^ creates a temporary value which is freed while still in use
| |
| type annotation requires that borrow lasts for `'a`
...
diff --git a/src/test/ui/regions/regions-var-type-out-of-scope.stderr b/src/test/ui/regions/regions-var-type-out-of-scope.stderr
index 476e82f04..c32bbe0ee 100644
--- a/src/test/ui/regions/regions-var-type-out-of-scope.stderr
+++ b/src/test/ui/regions/regions-var-type-out-of-scope.stderr
@@ -4,7 +4,7 @@ error[E0716]: temporary value dropped while borrowed
LL | x = &id(3);
| ^^^^^- temporary value is freed at the end of this statement
| |
- | creates a temporary which is freed while still in use
+ | creates a temporary value which is freed while still in use
LL | assert_eq!(*x, 3);
| ----------------- borrow later used here
|