diff options
| author | Brian Anderson <andersrb@gmail.com> | 2012-09-08 13:06:31 -0700 |
|---|---|---|
| committer | Brian Anderson <andersrb@gmail.com> | 2012-09-08 13:06:31 -0700 |
| commit | 940ef65e0e945f4c0e072ae4ebe86bfaddeb9710 (patch) | |
| tree | e119d7abe787c960a13a8c6f2c46bae6774d8e99 /src | |
| parent | 6be5fe2d47eb507d9b8dc746b608e0dddf2d233b (diff) | |
| parent | 00d1d4e647149aab6d3047cf8671b85384bd4fce (diff) | |
| download | rust-940ef65e0e945f4c0e072ae4ebe86bfaddeb9710.tar.gz rust-940ef65e0e945f4c0e072ae4ebe86bfaddeb9710.zip | |
Merge pull request #3426 from killerswan/fix_incoming_2
(fix incoming) Add the necessary traits to some generic functions
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/bench/task-perf-word-count-generic.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/test/bench/task-perf-word-count-generic.rs b/src/test/bench/task-perf-word-count-generic.rs index a67bb129482..a4dc2539eb3 100644 --- a/src/test/bench/task-perf-word-count-generic.rs +++ b/src/test/bench/task-perf-word-count-generic.rs @@ -17,6 +17,7 @@ use option::Some; use option::None; use std::map; use std::map::hashmap; +use hash::Hash; use io::WriterUtil; use std::time; @@ -25,6 +26,8 @@ use comm::Chan; use comm::Port; use comm::recv; use comm::send; +use cmp::Eq; +use to_bytes::IterBytes; macro_rules! move_out ( { $x:expr } => { unsafe { let y <- *ptr::addr_of($x); y } } @@ -145,7 +148,7 @@ mod map_reduce { enum reduce_proto<V: Copy Send> { emit_val(V), done, addref, release } - fn start_mappers<K1: Copy Send, K2: Const Copy Send hash_key, + fn start_mappers<K1: Copy Send, K2: Hash IterBytes Eq Const Copy Send hash_key, V: Copy Send>( map: mapper<K1, K2, V>, &ctrls: ~[ctrl_proto::server::open<K2, V>], @@ -162,7 +165,7 @@ mod map_reduce { return tasks; } - fn map_task<K1: Copy Send, K2: Const Copy Send hash_key, V: Copy Send>( + fn map_task<K1: Copy Send, K2: Hash IterBytes Eq Const Copy Send hash_key, V: Copy Send>( map: mapper<K1, K2, V>, ctrl: box<ctrl_proto::client::open<K2, V>>, input: K1) @@ -235,7 +238,7 @@ mod map_reduce { reduce(key, || get(p, ref_count, is_done) ); } - fn map_reduce<K1: Copy Send, K2: Const Copy Send hash_key, V: Copy Send>( + fn map_reduce<K1: Copy Send, K2: Hash IterBytes Eq Const Copy Send hash_key, V: Copy Send>( map: mapper<K1, K2, V>, reduce: reducer<K2, V>, inputs: ~[K1]) |
