Skip to content

Commit 406a410

Browse files
committed
---
yaml --- r: 6996 b: refs/heads/master c: 3a1710d h: refs/heads/master v: v3
1 parent 21e16ab commit 406a410

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 9f2369dc9f55a22cfc0bc8b62a8588afe2c8b2ca
2+
refs/heads/master: 3a1710d21e47948451cf93a65c841f172259df52

trunk/src/comp/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ fn encode_type_param_bounds(ebml_w: ebml::writer, ecx: @encode_ctxt,
190190
abbrevs: tyencode::ac_use_abbrevs(ecx.type_abbrevs)};
191191
for param in params {
192192
ebml::start_tag(ebml_w, tag_items_data_item_ty_param_bounds);
193-
let bs = ecx.ccx.tcx.ty_param_bounds.get(local_def(param.id));
193+
let bs = ecx.ccx.tcx.ty_param_bounds.get(param.id);
194194
tyencode::enc_bounds(io::new_writer(ebml_w.writer), ty_str_ctxt, bs);
195195
ebml::end_tag(ebml_w);
196196
}

trunk/src/comp/middle/trans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5093,7 +5093,7 @@ fn register_fn(ccx: @crate_ctxt, sp: span, path: [str], flav: str,
50935093
}
50945094

50955095
fn param_bounds(ccx: @crate_ctxt, tp: ast::ty_param) -> ty::param_bounds {
5096-
ccx.tcx.ty_param_bounds.get(ast_util::local_def(tp.id))
5096+
ccx.tcx.ty_param_bounds.get(tp.id)
50975097
}
50985098

50995099
fn register_fn_full(ccx: @crate_ctxt, sp: span, path: [str], _flav: str,

trunk/src/comp/middle/ty.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ type ctxt =
222222
ast_ty_to_ty_cache: hashmap<@ast::ty, option::t<t>>,
223223
tag_var_cache: hashmap<def_id, @[variant_info]>,
224224
iface_method_cache: hashmap<def_id, @[method]>,
225-
ty_param_bounds: hashmap<def_id, param_bounds>};
225+
ty_param_bounds: hashmap<ast::node_id, param_bounds>};
226226

227227
type ty_ctxt = ctxt;
228228

@@ -441,7 +441,7 @@ fn mk_ctxt(s: session::session, dm: resolve::def_map, amap: ast_map::map,
441441
map::mk_hashmap(ast_util::hash_ty, ast_util::eq_ty),
442442
tag_var_cache: new_def_hash(),
443443
iface_method_cache: new_def_hash(),
444-
ty_param_bounds: new_def_hash()};
444+
ty_param_bounds: map::new_int_hash()};
445445
populate_type_store(cx);
446446
ret cx;
447447
}
@@ -1085,7 +1085,9 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
10851085
}
10861086
// Resources are always noncopyable.
10871087
ty_res(did, inner, tps) { kind_noncopyable }
1088-
ty_param(_, did) { param_bounds_to_kind(cx.ty_param_bounds.get(did)) }
1088+
ty_param(_, did) {
1089+
param_bounds_to_kind(cx.ty_param_bounds.get(did.node))
1090+
}
10891091
ty_constr(t, _) { type_kind(cx, t) }
10901092
};
10911093

trunk/src/comp/middle/typeck.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ fn ty_param_bounds(tcx: ty::ctxt, mode: mode, params: [ast::ty_param])
507507
-> @[ty::param_bounds] {
508508
let result = [];
509509
for param in params {
510-
result += [alt tcx.ty_param_bounds.find(local_def(param.id)) {
510+
result += [alt tcx.ty_param_bounds.find(param.id) {
511511
some(bs) { bs }
512512
none. {
513513
let bounds = [];
@@ -521,7 +521,7 @@ fn ty_param_bounds(tcx: ty::ctxt, mode: mode, params: [ast::ty_param])
521521
}];
522522
}
523523
let boxed = @bounds;
524-
tcx.ty_param_bounds.insert(local_def(param.id), boxed);
524+
tcx.ty_param_bounds.insert(param.id, boxed);
525525
boxed
526526
}
527527
}];
@@ -1493,7 +1493,7 @@ fn lookup_method(fcx: @fn_ctxt, isc: resolve::iscopes,
14931493
// First, see whether this is an interface-bounded parameter
14941494
alt ty::struct(tcx, ty) {
14951495
ty::ty_param(n, did) {
1496-
for bound in *tcx.ty_param_bounds.get(did) {
1496+
for bound in *tcx.ty_param_bounds.get(did.node) {
14971497
alt bound {
14981498
ty::bound_iface(t) {
14991499
let (iid, _tps) = alt ty::struct(tcx, t) {
@@ -2789,7 +2789,7 @@ fn check_ty_params(ccx: @crate_ctxt, tps: [ast::ty_param]) {
27892789
for bound in *tp.bounds {
27902790
alt bound {
27912791
ast::bound_iface(at) {
2792-
let tbound = ccx.tcx.ty_param_bounds.get(local_def(tp.id))[i];
2792+
let tbound = ccx.tcx.ty_param_bounds.get(tp.id)[i];
27932793
let bound_ty = alt tbound { ty::bound_iface(t) { t } };
27942794
alt ty::struct(ccx.tcx, bound_ty) {
27952795
ty::ty_iface(_, _) {}

0 commit comments

Comments
 (0)