Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-Flash committed Feb 23, 2024
1 parent 4220f90 commit 0978d16
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,21 @@ fn foo() {
);
}

#[test]
fn replace_filter_map_next_dont_work_for_not_sized_issues_16596() {
check_diagnostics(
r#"
//- minicore: iterators
fn foo() {
let mut j = [0].into_iter();
let i: &mut dyn Iterator<Item = i32> = &mut j;
let dummy_fn = |v| (v > 0).then_some(v + 1);
let _res = i.filter_map(dummy_fn).next();
}
"#,
);
}

#[test]
fn replace_filter_map_next_with_find_map_no_diagnostic_without_next() {
check_diagnostics(
Expand Down

0 comments on commit 0978d16

Please sign in to comment.