diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2012-01-05 15:35:37 +0100 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2012-01-05 15:50:02 +0100 |
| commit | 60ae1590af034755b5cb1e1e71f2240a710299a2 (patch) | |
| tree | 605d11f071a776c0ca33dcfea0a774379b0880bb /src/comp/middle | |
| parent | 1f71a0f48d18d80ff3be6970d582c5a67f976329 (diff) | |
Switch to new param kind bound syntax
And remove support for the old syntax
Diffstat (limited to 'src/comp/middle')
| -rw-r--r-- | src/comp/middle/ast_map.rs | 6 | ||||
| -rw-r--r-- | src/comp/middle/debuginfo.rs | 4 | ||||
| -rw-r--r-- | src/comp/middle/ty.rs | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/comp/middle/ast_map.rs b/src/comp/middle/ast_map.rs index abf3d0cac1e..b5e53ab305a 100644 --- a/src/comp/middle/ast_map.rs +++ b/src/comp/middle/ast_map.rs @@ -98,7 +98,7 @@ fn map_expr(cx: ctx, ex: @expr) { } } -fn new_smallintmap_int_adapter<copy V>() -> std::map::hashmap<int, V> { +fn new_smallintmap_int_adapter<V: copy>() -> 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); @@ -109,11 +109,11 @@ fn new_smallintmap_int_adapter<copy 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<copy K, copy V>(key_idx: fn(K) -> uint, +fn new_smallintmap_adapter<K: copy, V: copy>(key_idx: fn(K) -> uint, idx_key: fn(uint) -> K) -> std::map::hashmap<K, V> { - obj adapter<copy K, copy V>(map: smallintmap::smallintmap<V>, + obj adapter<K: copy, V: copy>(map: smallintmap::smallintmap<V>, key_idx: fn(K) -> uint, idx_key: fn(uint) -> K) { diff --git a/src/comp/middle/debuginfo.rs b/src/comp/middle/debuginfo.rs index bdb76dfd921..1c74cb7b171 100644 --- a/src/comp/middle/debuginfo.rs +++ b/src/comp/middle/debuginfo.rs @@ -118,7 +118,7 @@ tag debug_metadata { retval_metadata(@metadata<retval_md>); } -fn cast_safely<copy T, U>(val: T) -> U unsafe { +fn cast_safely<T: copy, U>(val: T) -> U unsafe { let val2 = val; let val3 = unsafe::reinterpret_cast(val2); unsafe::leak(val2); @@ -138,7 +138,7 @@ fn md_from_metadata<T>(val: debug_metadata) -> T unsafe { } } -fn cached_metadata<copy T>(cache: metadata_cache, mdtag: int, +fn cached_metadata<T: copy>(cache: metadata_cache, mdtag: int, eq: block(md: T) -> bool) -> option::t<T> unsafe { if cache.contains_key(mdtag) { let items = cache.get(mdtag); diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index 76a3591cd18..50f015512f4 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -414,7 +414,7 @@ fn mk_rcache() -> creader_cache { ret map::mk_hashmap(hash_cache_entry, eq_cache_entries); } -fn new_ty_hash<copy V>() -> map::hashmap<t, V> { map::new_uint_hash() } +fn new_ty_hash<V: copy>() -> map::hashmap<t, V> { map::new_uint_hash() } fn mk_ctxt(s: session::session, dm: resolve::def_map, amap: ast_map::map, freevars: freevars::freevar_map) -> ctxt { |
