Skip to content

Commit 145feb3

Browse files
committed
Add a test for binding bare functions
Issue #1022
1 parent 5b0f79b commit 145feb3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/test/run-pass/fn-bare-bind.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
fn# f(i: int) {
2+
assert i == 10;
3+
}
4+
5+
fn main() {
6+
// Binding a bare function turns it into a shared closure
7+
let g: fn() = bind f(10);
8+
g();
9+
}

0 commit comments

Comments
 (0)