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

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

11 lines
269 B
Rust
Raw Normal View History

// run-pass
// Test that overloaded calls work with zero arity closures
// pretty-expanded FIXME #23616
fn main() {
2019-05-28 18:47:21 +00:00
let functions: [Box<dyn Fn() -> Option<()>>; 1] = [Box::new(|| None)];
let _: Option<Vec<()>> = functions.iter().map(|f| (*f)()).collect();
}