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.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/regression.rs b/crates/hir-ty/src/tests/regression.rs index 658c304aac..1939db0ef5 100644 --- a/crates/hir-ty/src/tests/regression.rs +++ b/crates/hir-ty/src/tests/regression.rs @@ -2795,3 +2795,23 @@ fn foo() { "#]], ); } + +#[test] +fn regression_21742() { + check_no_mismatches( + r#" +pub trait IntoIterator { + type Item; +} + +pub trait Collection: IntoIterator<Item = <Self as Collection>::Item> { + type Item; + fn contains(&self, item: &<Self as Collection>::Item); +} + +fn contains_0<S: Collection<Item = i32>>(points: &S) { + points.contains(&0) +} + "#, + ); +} |