Skip to content

Commit dc707b9

Browse files
committed
---
yaml --- r: 2205 b: refs/heads/master c: e0eccad h: refs/heads/master i: 2203: 9880192 v: v3
1 parent f7c0168 commit dc707b9

File tree

6 files changed

+413
-384
lines changed

6 files changed

+413
-384
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: 3d62c9adf35e8685f131be50afbcc711bb43cf60
2+
refs/heads/master: e0eccaddb2bad87993505fffc523a47b68018e64

trunk/src/comp/front/creader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ fn get_tag_variants(session.session sess,
546546
auto item = find_item(did._1, items);
547547
auto ctor_ty = item_type(item, external_crate_id, tystore);
548548
let vec[ty.t] arg_tys = vec();
549-
alt (ty.struct(ctor_ty)) {
549+
alt (ty.struct(tystore, ctor_ty)) {
550550
case (ty.ty_fn(_, ?args, _)) {
551551
for (ty.arg a in args) {
552552
arg_tys += vec(a.ty);

trunk/src/comp/middle/metadata.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ const uint tag_index_table = 0x15u;
5252
mod Encode {
5353

5454
type ctxt = rec(
55-
fn(ast.def_id) -> str ds // Callback to translate defs to strs.
55+
fn(ast.def_id) -> str ds, // Callback to translate defs to strs.
56+
@ty.type_store tystore // The type store.
5657
);
5758

5859
fn ty_str(@ctxt cx, ty.t t) -> str {
59-
ret sty_str(cx, ty.struct(t));
60+
ret sty_str(cx, ty.struct(cx.tystore, t));
6061
}
6162

6263
fn mt_str(@ctxt cx, &ty.mt mt) -> str {
@@ -332,11 +333,11 @@ fn encode_variant_id(&ebml.writer ebml_w, ast.def_id vid) {
332333
ebml.end_tag(ebml_w);
333334
}
334335

335-
fn encode_type(&ebml.writer ebml_w, ty.t typ) {
336+
fn encode_type(@trans.crate_ctxt cx, &ebml.writer ebml_w, ty.t typ) {
336337
ebml.start_tag(ebml_w, tag_items_data_item_type);
337338

338339
auto f = def_to_str;
339-
auto ty_str_ctxt = @rec(ds=f);
340+
auto ty_str_ctxt = @rec(ds=f, tystore=cx.tystore);
340341
ebml_w.writer.write(_str.bytes(Encode.ty_str(ty_str_ctxt, typ)));
341342

342343
ebml.end_tag(ebml_w);
@@ -379,7 +380,7 @@ fn encode_tag_variant_info(@trans.crate_ctxt cx, &ebml.writer ebml_w,
379380
encode_def_id(ebml_w, variant.node.id);
380381
encode_kind(ebml_w, 'v' as u8);
381382
encode_tag_id(ebml_w, did);
382-
encode_type(ebml_w, trans.node_ann_type(cx, variant.node.ann));
383+
encode_type(cx, ebml_w, trans.node_ann_type(cx, variant.node.ann));
383384
if (_vec.len[ast.variant_arg](variant.node.args) > 0u) {
384385
encode_symbol(cx, ebml_w, variant.node.id);
385386
}
@@ -396,7 +397,7 @@ fn encode_info_for_item(@trans.crate_ctxt cx, &ebml.writer ebml_w,
396397
ebml.start_tag(ebml_w, tag_items_data_item);
397398
encode_def_id(ebml_w, did);
398399
encode_kind(ebml_w, 'c' as u8);
399-
encode_type(ebml_w, trans.node_ann_type(cx, ann));
400+
encode_type(cx, ebml_w, trans.node_ann_type(cx, ann));
400401
encode_symbol(cx, ebml_w, did);
401402
ebml.end_tag(ebml_w);
402403
}
@@ -405,7 +406,7 @@ fn encode_info_for_item(@trans.crate_ctxt cx, &ebml.writer ebml_w,
405406
encode_def_id(ebml_w, did);
406407
encode_kind(ebml_w, 'f' as u8);
407408
encode_type_param_count(ebml_w, tps);
408-
encode_type(ebml_w, trans.node_ann_type(cx, ann));
409+
encode_type(cx, ebml_w, trans.node_ann_type(cx, ann));
409410
encode_symbol(cx, ebml_w, did);
410411
ebml.end_tag(ebml_w);
411412
}
@@ -426,15 +427,15 @@ fn encode_info_for_item(@trans.crate_ctxt cx, &ebml.writer ebml_w,
426427
encode_def_id(ebml_w, did);
427428
encode_kind(ebml_w, 'y' as u8);
428429
encode_type_param_count(ebml_w, tps);
429-
encode_type(ebml_w, trans.node_ann_type(cx, ann));
430+
encode_type(cx, ebml_w, trans.node_ann_type(cx, ann));
430431
ebml.end_tag(ebml_w);
431432
}
432433
case (ast.item_tag(?id, ?variants, ?tps, ?did, ?ann)) {
433434
ebml.start_tag(ebml_w, tag_items_data_item);
434435
encode_def_id(ebml_w, did);
435436
encode_kind(ebml_w, 't' as u8);
436437
encode_type_param_count(ebml_w, tps);
437-
encode_type(ebml_w, trans.node_ann_type(cx, ann));
438+
encode_type(cx, ebml_w, trans.node_ann_type(cx, ann));
438439
for (ast.variant v in variants) {
439440
encode_variant_id(ebml_w, v.node.id);
440441
}
@@ -448,15 +449,15 @@ fn encode_info_for_item(@trans.crate_ctxt cx, &ebml.writer ebml_w,
448449
encode_kind(ebml_w, 'o' as u8);
449450
encode_type_param_count(ebml_w, tps);
450451
auto fn_ty = trans.node_ann_type(cx, ann);
451-
encode_type(ebml_w, fn_ty);
452+
encode_type(cx, ebml_w, fn_ty);
452453
encode_symbol(cx, ebml_w, odid.ctor);
453454
ebml.end_tag(ebml_w);
454455

455456
ebml.start_tag(ebml_w, tag_items_data_item);
456457
encode_def_id(ebml_w, odid.ty);
457458
encode_kind(ebml_w, 'y' as u8);
458459
encode_type_param_count(ebml_w, tps);
459-
encode_type(ebml_w, ty.ty_fn_ret(fn_ty));
460+
encode_type(cx, ebml_w, ty.ty_fn_ret(cx.tystore, fn_ty));
460461
ebml.end_tag(ebml_w);
461462
}
462463
}
@@ -469,13 +470,13 @@ fn encode_info_for_native_item(@trans.crate_ctxt cx, &ebml.writer ebml_w,
469470
case (ast.native_item_ty(_, ?did)) {
470471
encode_def_id(ebml_w, did);
471472
encode_kind(ebml_w, 'T' as u8);
472-
encode_type(ebml_w, ty.mk_native(cx.tystore));
473+
encode_type(cx, ebml_w, ty.mk_native(cx.tystore));
473474
}
474475
case (ast.native_item_fn(_, _, _, ?tps, ?did, ?ann)) {
475476
encode_def_id(ebml_w, did);
476477
encode_kind(ebml_w, 'F' as u8);
477478
encode_type_param_count(ebml_w, tps);
478-
encode_type(ebml_w, trans.node_ann_type(cx, ann));
479+
encode_type(cx, ebml_w, trans.node_ann_type(cx, ann));
479480
encode_symbol(cx, ebml_w, did);
480481
}
481482
}

0 commit comments

Comments
 (0)