Skip to content

Commit

Permalink
Add regression test for rust-lang#11561
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Oct 6, 2023
1 parent 8467259 commit 6b12bcc
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 @@ -279,6 +279,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 6b12bcc

Please sign in to comment.