From 85504064de6d03158f63d5e372b31bed33a4d40b Mon Sep 17 00:00:00 2001 From: Richo Healey Date: Wed, 12 Nov 2014 14:51:59 -0800 Subject: [PATCH] test: failure in infer --- src/test/run-pass/option-closure.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/test/run-pass/option-closure.rs diff --git a/src/test/run-pass/option-closure.rs b/src/test/run-pass/option-closure.rs new file mode 100644 index 0000000000000..6f747e0857c6d --- /dev/null +++ b/src/test/run-pass/option-closure.rs @@ -0,0 +1,23 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn calls(cb: Option<|&str, &i32|>) { + let s = "foo"; + let i = 32; + + match cb { + Some(cb) => cb(s, &i), + _ => {}, + } + +} +fn main() { + calls(Some(|s, u| {})); +}