/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
- use std;
- import comm::chan;
- import comm::send;
- import comm::port;
- // tests that ctrl's type gets inferred properly
- type command<K: send, V: send> = {key: K, val: V};
- fn cache_server<K: send, V: send>(c: chan<chan<command<K, V>>>) {
- let ctrl = port();
- send(c, chan(ctrl));
- }
- fn main() { }