Skip to content

Commit d9dedbd

Browse files
committed
add test case
1 parent fa26992 commit d9dedbd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

crates/ide-diagnostics/src/handlers/replace_filter_map_next_with_find_map.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,21 @@ fn foo() {
8080
);
8181
}
8282

83+
#[test]
84+
fn replace_filter_map_next_dont_work_for_not_sized_issues_16596() {
85+
check_diagnostics(
86+
r#"
87+
//- minicore: iterators
88+
fn foo() {
89+
let mut j = [0].into_iter();
90+
let i: &mut dyn Iterator<Item = i32> = &mut j;
91+
let dummy_fn = |v| (v > 0).then_some(v + 1);
92+
let _res = i.filter_map(dummy_fn).next();
93+
}
94+
"#,
95+
);
96+
}
97+
8398
#[test]
8499
fn replace_filter_map_next_with_find_map_no_diagnostic_without_next() {
85100
check_diagnostics(

0 commit comments

Comments
 (0)