Add regression test for #11561

This commit is contained in:
Guillaume Gomez 2023-10-06 11:24:35 +02:00
parent 3b4b07c5f8
commit 3e6db95e30

View File

@ -297,6 +297,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];