rust/tests/ui/closures/2229_closure_analysis/run_pass/issue-88372.rs
2024-02-16 20:02:50 +00:00

20 lines
279 B
Rust

//@ edition:2021
//@ run-pass
fn solve<F>(validate: F) -> Option<u64>
where
F: Fn(&mut [i8; 1]),
{
let mut position: [i8; 1] = [1];
Some(0).map(|_| {
validate(&mut position);
let [_x] = position;
0
})
}
fn main() {
solve(|_| ());
}