diff options
| author | Stefan Plantikow <stefan.plantikow@googlemail.com> | 2012-01-05 17:18:40 +0100 |
|---|---|---|
| committer | Stefan Plantikow <stefan.plantikow@googlemail.com> | 2012-01-05 17:20:13 +0100 |
| commit | c8467977c4e0e3c719d83334d7290cbea127bb13 (patch) | |
| tree | f7f501c63ed5a2b960279bdbf51e216684d1b53c /src/comp/middle | |
| parent | 1f10ee365c840cb5d54fe4eb32659f09d29ace38 (diff) | |
| parent | cc929fc9f9de6cf2d44df46ffc4b4d6e58e3a508 (diff) | |
Merge branch 'master' into kmath
Conflicts: src/libcore/float.rs
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/trans.rs | 6 | ||||
| -rw-r--r-- | src/comp/middle/ty.rs | 2 | ||||
| -rw-r--r-- | src/comp/middle/typeck.rs | 2 |
5 files changed, 8 insertions, 12 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/trans.rs b/src/comp/middle/trans.rs index 4325f0af52b..6baef415ccd 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -5354,7 +5354,7 @@ fn collect_item(ccx: @crate_ctxt, abi: @mutable option::t<ast::native_abi>, register_fn(ccx, i.span, new_pt, "obj_ctor", tps, ctor_id); } ast::item_impl(tps, _, _, methods) { - let name = ccx.names.next(i.ident); + let name = i.ident + int::str(i.id); for m in methods { register_fn(ccx, i.span, pt + [name, m.ident], "impl_method", tps + m.tps, m.id); @@ -5418,9 +5418,7 @@ fn trans_constant(ccx: @crate_ctxt, it: @ast::item, &&pt: [str], ast::item_impl(tps, some(@{node: ast::ty_path(_, id), _}), _, ms) { let i_did = ast_util::def_id_of_def(ccx.tcx.def_map.get(id)); let ty = ty::lookup_item_type(ccx.tcx, i_did).ty; - // FIXME[impl] use the same name as used in collect_items, for - // slightly more consistent symbol names? - let new_pt = pt + [ccx.names.next(it.ident)]; + let new_pt = pt + [it.ident + int::str(it.id), "wrap"]; let extra_tps = vec::map(tps, {|p| param_bounds(ccx, p)}); let tbl = C_struct(vec::map(*ty::iface_methods(ccx.tcx, i_did), {|im| alt vec::find(ms, {|m| m.ident == im.ident}) { diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index 1466d4cf030..a993fbae897 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 { diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs index 02e1ed9d4f2..d426aa290e0 100644 --- a/src/comp/middle/typeck.rs +++ b/src/comp/middle/typeck.rs @@ -2920,8 +2920,6 @@ mod dict { bind_params(fcx, self_ty, n_tps) } else { {vars: [], ty: self_ty} }; let im_bs = ty::lookup_item_type(tcx, im.did).bounds; - // FIXME[impl] don't do this in fcx (or make - // unify transactional by scrubbing bindings on fail) alt unify::unify(fcx, ty, self_ty) { ures_ok(_) { if option::is_some(found) { |
