Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/regression.rs')
-rw-r--r--crates/hir-ty/src/tests/regression.rs53
1 files changed, 53 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/regression.rs b/crates/hir-ty/src/tests/regression.rs
index fd8c641d86..966433369a 100644
--- a/crates/hir-ty/src/tests/regression.rs
+++ b/crates/hir-ty/src/tests/regression.rs
@@ -2439,3 +2439,56 @@ pub fn null_mut<T: PointeeSized + Thin>() -> *mut T {
"#,
);
}
+
+#[test]
+fn issue_20484() {
+ check_no_mismatches(
+ r#"
+struct Eth;
+
+trait FullBlockBody {
+ type Transaction;
+}
+
+impl FullBlockBody for () {
+ type Transaction = ();
+}
+
+trait NodePrimitives {
+ type BlockBody;
+ type SignedTx;
+}
+
+impl NodePrimitives for () {
+ type BlockBody = ();
+ type SignedTx = ();
+}
+
+impl NodePrimitives for Eth {
+ type BlockBody = ();
+ type SignedTx = ();
+}
+
+trait FullNodePrimitives
+where
+ Self: NodePrimitives<BlockBody: FullBlockBody<Transaction = Self::SignedTx>>,
+{
+}
+
+impl<T> FullNodePrimitives for T where
+ T: NodePrimitives<BlockBody: FullBlockBody<Transaction = Self::SignedTx>>,
+{
+}
+
+fn node<N>(_: N)
+where
+ N: FullNodePrimitives,
+{
+}
+
+fn main() {
+ node(Eth);
+}
+"#,
+ );
+}