about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-09-11 07:17:12 +0000
committerbors <bors@rust-lang.org>2024-09-11 07:17:12 +0000
commit5a2dd7d4f3210629e65879aeecbe643ba3b86bb4 (patch)
tree5497eb2657e5c1804b60b894776d39ac41c5825c /tests
parent4c5fc2c334f1cc305eea79ed0b8fdb276342d101 (diff)
parent7a57a74bf52306d18d265fa4b498064634c91652 (diff)
downloadrust-5a2dd7d4f3210629e65879aeecbe643ba3b86bb4.tar.gz
rust-5a2dd7d4f3210629e65879aeecbe643ba3b86bb4.zip
Auto merge of #130194 - lcnr:generalize-cache, r=compiler-errors
generalize: track relevant info in cache key

This was previously theoretically incomplete as we could incorrectly generalize as if the type was in an invariant context even though we're in a covariant one. Similar with the `in_alias` flag.

r? `@compiler-errors`
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/const-generics/occurs-check/unused-substs-3.rs6
-rw-r--r--tests/ui/const-generics/occurs-check/unused-substs-3.stderr8
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/ui/const-generics/occurs-check/unused-substs-3.rs b/tests/ui/const-generics/occurs-check/unused-substs-3.rs
index 6db18d587d3..dfb051192e2 100644
--- a/tests/ui/const-generics/occurs-check/unused-substs-3.rs
+++ b/tests/ui/const-generics/occurs-check/unused-substs-3.rs
@@ -11,9 +11,11 @@ fn bind<T>() -> (T, [u8; 6 + 1]) {
 
 fn main() {
     let (mut t, foo) = bind();
+    //~^ ERROR mismatched types
+    //~| NOTE cyclic type
+
     // `t` is `ty::Infer(TyVar(?1t))`
     // `foo` contains `ty::Infer(TyVar(?1t))` in its substs
     t = foo;
-    //~^ ERROR mismatched types
-    //~| NOTE cyclic type
+
 }
diff --git a/tests/ui/const-generics/occurs-check/unused-substs-3.stderr b/tests/ui/const-generics/occurs-check/unused-substs-3.stderr
index bcb59705c6b..30a2a7901bd 100644
--- a/tests/ui/const-generics/occurs-check/unused-substs-3.stderr
+++ b/tests/ui/const-generics/occurs-check/unused-substs-3.stderr
@@ -1,10 +1,8 @@
 error[E0308]: mismatched types
-  --> $DIR/unused-substs-3.rs:16:9
+  --> $DIR/unused-substs-3.rs:13:24
    |
-LL |     t = foo;
-   |         ^^^- help: try using a conversion method: `.to_vec()`
-   |         |
-   |         cyclic type of infinite size
+LL |     let (mut t, foo) = bind();
+   |                        ^^^^^^ cyclic type of infinite size
 
 error: aborting due to 1 previous error