0
0
mirror of https://github.com/rust-lang/rust.git synced 2024-11-30 11:53:52 +01:00

Add a test for binding bare functions

Issue #1022
This commit is contained in:
Brian Anderson 2011-10-10 13:58:40 -07:00
parent 5b0f79b75a
commit 145feb3298

View File

@ -0,0 +1,9 @@
fn# f(i: int) {
assert i == 10;
}
fn main() {
// Binding a bare function turns it into a shared closure
let g: fn() = bind f(10);
g();
}