PageRenderTime 10ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/run-pass/fun-indirect-call.rs

http://github.com/jruderman/rust
Rust | 11 lines | 6 code | 4 blank | 1 comment | 1 complexity | 9015a763a10c2eae6d5db1cc003a559c MD5 | raw file
 1
 2
 3
 4// -*- rust -*-
 5fn f() -> int { return 42; }
 6
 7fn main() {
 8    let g: extern fn() -> int = f;
 9    let i: int = g();
10    assert (i == 42);
11}