rust/tests/ui/closures/2229_closure_analysis/run_pass/issue-88372.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
277 B
Rust
Raw Normal View History

// 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(|_| ());
}