rust/tests/run-pass/issue-20575.rs
2019-02-26 18:37:45 +00:00

8 lines
223 B
Rust

// Test that overloaded calls work with zero arity closures
fn main() {
let functions: [Box<Fn() -> Option<()>>; 1] = [Box::new(|| None)];
let _val: Option<Vec<()>> = functions.iter().map(|f| (*f)()).collect();
}