Skip to content

Commit

Permalink
Add regression test for #11561
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Oct 17, 2023
1 parent 03e00e9 commit 800ecf5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/ui/needless_pass_by_ref_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ fn true_setter(b: &mut bool) -> impl FnOnce() + '_ {
move || set_true(b)
}

// Should not warn.
fn filter_copy<T: Copy>(predicate: &mut impl FnMut(T) -> bool) -> impl FnMut(&T) -> bool + '_ {
move |&item| predicate(item)
}

fn main() {
let mut u = 0;
let mut v = vec![0];
Expand Down

0 comments on commit 800ecf5

Please sign in to comment.