Skip to content

Commit 940ef65

Browse files
committed
Merge pull request #3426 from killerswan/fix_incoming_2
(fix incoming) Add the necessary traits to some generic functions
2 parents 6be5fe2 + 00d1d4e commit 940ef65

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/test/bench/task-perf-word-count-generic.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use option::Some;
1717
use option::None;
1818
use std::map;
1919
use std::map::hashmap;
20+
use hash::Hash;
2021
use io::WriterUtil;
2122

2223
use std::time;
@@ -25,6 +26,8 @@ use comm::Chan;
2526
use comm::Port;
2627
use comm::recv;
2728
use comm::send;
29+
use cmp::Eq;
30+
use to_bytes::IterBytes;
2831

2932
macro_rules! move_out (
3033
{ $x:expr } => { unsafe { let y <- *ptr::addr_of($x); y } }
@@ -145,7 +148,7 @@ mod map_reduce {
145148

146149
enum reduce_proto<V: Copy Send> { emit_val(V), done, addref, release }
147150

148-
fn start_mappers<K1: Copy Send, K2: Const Copy Send hash_key,
151+
fn start_mappers<K1: Copy Send, K2: Hash IterBytes Eq Const Copy Send hash_key,
149152
V: Copy Send>(
150153
map: mapper<K1, K2, V>,
151154
&ctrls: ~[ctrl_proto::server::open<K2, V>],
@@ -162,7 +165,7 @@ mod map_reduce {
162165
return tasks;
163166
}
164167

165-
fn map_task<K1: Copy Send, K2: Const Copy Send hash_key, V: Copy Send>(
168+
fn map_task<K1: Copy Send, K2: Hash IterBytes Eq Const Copy Send hash_key, V: Copy Send>(
166169
map: mapper<K1, K2, V>,
167170
ctrl: box<ctrl_proto::client::open<K2, V>>,
168171
input: K1)
@@ -235,7 +238,7 @@ mod map_reduce {
235238
reduce(key, || get(p, ref_count, is_done) );
236239
}
237240

238-
fn map_reduce<K1: Copy Send, K2: Const Copy Send hash_key, V: Copy Send>(
241+
fn map_reduce<K1: Copy Send, K2: Hash IterBytes Eq Const Copy Send hash_key, V: Copy Send>(
239242
map: mapper<K1, K2, V>,
240243
reduce: reducer<K2, V>,
241244
inputs: ~[K1])

0 commit comments

Comments
 (0)