mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 11:53:52 +01:00
parent
5b0f79b75a
commit
145feb3298
9
src/test/run-pass/fn-bare-bind.rs
Normal file
9
src/test/run-pass/fn-bare-bind.rs
Normal 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();
|
||||
}
|
Loading…
Reference in New Issue
Block a user