Skip to content

Commit 800ecf5

Browse files
Add regression test for #11561
1 parent 03e00e9 commit 800ecf5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/ui/needless_pass_by_ref_mut.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,11 @@ fn true_setter(b: &mut bool) -> impl FnOnce() + '_ {
285285
move || set_true(b)
286286
}
287287

288+
// Should not warn.
289+
fn filter_copy<T: Copy>(predicate: &mut impl FnMut(T) -> bool) -> impl FnMut(&T) -> bool + '_ {
290+
move |&item| predicate(item)
291+
}
292+
288293
fn main() {
289294
let mut u = 0;
290295
let mut v = vec![0];

0 commit comments

Comments
 (0)