Skip to content

Commit 3e6db95

Browse files
Add regression test for #11561
1 parent 3b4b07c commit 3e6db95

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/ui/needless_pass_by_ref_mut.rs

+5
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ fn true_setter(b: &mut bool) -> impl FnOnce() + '_ {
297297
move || set_true(b)
298298
}
299299

300+
// Should not warn.
301+
fn filter_copy<T: Copy>(predicate: &mut impl FnMut(T) -> bool) -> impl FnMut(&T) -> bool + '_ {
302+
move |&item| predicate(item)
303+
}
304+
300305
fn main() {
301306
let mut u = 0;
302307
let mut v = vec![0];

0 commit comments

Comments
 (0)