diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2011-11-18 12:39:20 +0100 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2011-11-18 12:49:01 +0100 |
| commit | f6491bb42636f4c43f3cbb48fdb98ddd749e6e5d (patch) | |
| tree | c22607ada38b85ce4fadda6cf89998f6684a4964 /src/comp/middle | |
| parent | 8f8ebb550cf7e641d7dedd56e08efd4f0e15afab (diff) | |
| download | rust-f6491bb42636f4c43f3cbb48fdb98ddd749e6e5d.tar.gz rust-f6491bb42636f4c43f3cbb48fdb98ddd749e6e5d.zip | |
Update stdlib, compiler, and tests to new kind system
This involved adding 'copy' to more generics than I hoped, but an experiment with making it implicit showed that that way lies madness -- unless enforced, you will not remember to mark functions that don't copy as not requiring copyable kind. Issue #1177
Diffstat (limited to 'src/comp/middle')
| -rw-r--r-- | src/comp/middle/ast_map.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/comp/middle/ast_map.rs b/src/comp/middle/ast_map.rs index 240e14749e9..af4a5272246 100644 --- a/src/comp/middle/ast_map.rs +++ b/src/comp/middle/ast_map.rs @@ -74,7 +74,7 @@ fn map_expr(cx: ctx, ex: @expr) { cx.map.insert(ex.id, node_expr(ex)); } -fn new_smallintmap_int_adapter<V>() -> std::map::hashmap<int, V> { +fn new_smallintmap_int_adapter<copy V>() -> std::map::hashmap<int, V> { let key_idx = fn (&&key: int) -> uint { key as uint }; let idx_key = fn (idx: uint) -> int { idx as int }; ret new_smallintmap_adapter(key_idx, idx_key); @@ -85,11 +85,11 @@ fn new_smallintmap_int_adapter<V>() -> std::map::hashmap<int, V> { // the entire codebase adapting all the callsites to the different // interface. // FIXME: hashmap and smallintmap should support the same interface. -fn new_smallintmap_adapter<K, V>(key_idx: fn(K) -> uint, - idx_key: fn(uint) -> K) +fn new_smallintmap_adapter<copy K, copy V>(key_idx: fn(K) -> uint, + idx_key: fn(uint) -> K) -> std::map::hashmap<K, V> { - obj adapter<shar K, shar V>(map: smallintmap::smallintmap<V>, + obj adapter<copy K, copy V>(map: smallintmap::smallintmap<V>, key_idx: fn(K) -> uint, idx_key: fn(uint) -> K) { |
