/src/test/run-pass/send-type-inference.rs

http://github.com/jruderman/rust · Rust · 13 lines · 10 code · 2 blank · 1 comment · 0 complexity · 3ef4dfce3ee1da3eb4b3118d998a4471 MD5 · raw file

  1. use std;
  2. import comm::chan;
  3. import comm::send;
  4. import comm::port;
  5. // tests that ctrl's type gets inferred properly
  6. type command<K: send, V: send> = {key: K, val: V};
  7. fn cache_server<K: send, V: send>(c: chan<chan<command<K, V>>>) {
  8. let ctrl = port();
  9. send(c, chan(ctrl));
  10. }
  11. fn main() { }