Unnamed repository; edit this file 'description' to name the repository.
Merge pull request #20769 from ChayimFriedman2/ns-cleanup4
minor: Add regression test for another (long-standing) bug fixed by the new solver
Chayim Refael Friedman 7 months ago
parent d733c07 · parent 6e04e82 · commit a6bc4a4
-rw-r--r--crates/hir-ty/src/tests/regression/new_solver.rs24
1 files changed, 23 insertions, 1 deletions
diff --git a/crates/hir-ty/src/tests/regression/new_solver.rs b/crates/hir-ty/src/tests/regression/new_solver.rs
index c7711f31bf..adc35cc9bc 100644
--- a/crates/hir-ty/src/tests/regression/new_solver.rs
+++ b/crates/hir-ty/src/tests/regression/new_solver.rs
@@ -1,6 +1,6 @@
use expect_test::expect;
-use crate::tests::{check_infer, check_no_mismatches};
+use crate::tests::{check_infer, check_no_mismatches, check_types};
#[test]
fn regression_20365() {
@@ -450,3 +450,25 @@ fn main() {
"#,
);
}
+
+#[test]
+fn double_into_iter() {
+ check_types(
+ r#"
+//- minicore: iterator
+
+fn intoiter_issue<A, B>(foo: A)
+where
+ A: IntoIterator<Item = B>,
+ B: IntoIterator<Item = usize>,
+{
+ for x in foo {
+ // ^ B
+ for m in x {
+ // ^ usize
+ }
+ }
+}
+"#,
+ );
+}