rust/tests/pass/issues/issue-20575.rs

8 lines
227 B
Rust
Raw Normal View History

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