/src/test/run-pass/expr-block-fn.rs

http://github.com/jruderman/rust · Rust · 10 lines · 7 code · 3 blank · 0 comment · 1 complexity · 69bcc6405e0cf7aa5c81c222a7a59daf MD5 · raw file

  1. fn test_fn() {
  2. type t = extern fn() -> int;
  3. fn ten() -> int { return 10; }
  4. let rs: t = { ten };
  5. assert (rs() == 10);
  6. }
  7. fn main() { test_fn(); }