Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/traits.rs')
-rw-r--r--crates/hir-ty/src/tests/traits.rs38
1 files changed, 38 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/traits.rs b/crates/hir-ty/src/tests/traits.rs
index 4bc3e121ac..7a318877b7 100644
--- a/crates/hir-ty/src/tests/traits.rs
+++ b/crates/hir-ty/src/tests/traits.rs
@@ -4765,3 +4765,41 @@ fn test() {
"#,
);
}
+
+#[test]
+fn associated_type_with_impl_trait_in_tuple() {
+ check_no_mismatches(
+ r#"
+pub trait Iterator {
+ type Item;
+}
+
+pub trait Value {}
+
+fn bar<I: Iterator<Item = (usize, impl Value)>>() {}
+
+fn foo() {
+ bar();
+}
+"#,
+ );
+}
+
+#[test]
+fn associated_type_with_impl_trait_in_nested_tuple() {
+ check_no_mismatches(
+ r#"
+pub trait Iterator {
+ type Item;
+}
+
+pub trait Value {}
+
+fn bar<I: Iterator<Item = ((impl Value, usize), u32)>>() {}
+
+fn foo() {
+ bar();
+}
+"#,
+ );
+}