about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRyo Yoshida <low.ryoshida@gmail.com>2023-03-19 16:58:10 +0900
committerRyo Yoshida <low.ryoshida@gmail.com>2023-03-19 16:58:10 +0900
commite12460bbca48ec354c40caf51603ddc9f97c17a5 (patch)
tree0cab851d983b0bb82234399fee4568e589274a1a
parent1d1a86f3508581b5867df202c87016520fd221a5 (diff)
downloadrust-e12460bbca48ec354c40caf51603ddc9f97c17a5.tar.gz
rust-e12460bbca48ec354c40caf51603ddc9f97c17a5.zip
Add regression test
so that we can catch regressions when we move away from chalk.
-rw-r--r--crates/hir-ty/src/tests/regression.rs32
1 files changed, 32 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/regression.rs b/crates/hir-ty/src/tests/regression.rs
index e6b4f13c8d1..689f0da44f6 100644
--- a/crates/hir-ty/src/tests/regression.rs
+++ b/crates/hir-ty/src/tests/regression.rs
@@ -1756,3 +1756,35 @@ const C: usize = 2 + 2;
 "#,
     );
 }
+
+#[test]
+fn regression_14164() {
+    check_types(
+        r#"
+trait Rec {
+    type K;
+    type Rebind<Tok>: Rec<K = Tok>;
+}
+
+trait Expr<K> {
+    type Part: Rec<K = K>;
+    fn foo(_: <Self::Part as Rec>::Rebind<i32>) {}
+}
+
+struct Head<K>(K);
+impl<K> Rec for Head<K> {
+    type K = K;
+    type Rebind<Tok> = Head<Tok>;
+}
+
+fn test<E>()
+where
+    E: Expr<usize, Part = Head<usize>>,
+{
+    let head;
+      //^^^^ Head<i32>
+    E::foo(head);
+}
+"#,
+    );
+}