diff options
Diffstat (limited to 'tests/ui/functions-closures/closure-inference2.rs')
-rw-r--r-- | tests/ui/functions-closures/closure-inference2.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/functions-closures/closure-inference2.rs b/tests/ui/functions-closures/closure-inference2.rs new file mode 100644 index 000000000..4ce132e86 --- /dev/null +++ b/tests/ui/functions-closures/closure-inference2.rs @@ -0,0 +1,9 @@ +// run-pass +// Test a rather underspecified example: +#![allow(unused_braces)] + +pub fn main() { + let f = {|i| i}; + assert_eq!(f(2), 2); + assert_eq!(f(5), 5); +} |