Skip to content

Commit c251950

Browse files
committed
---
yaml --- r: 36152 b: refs/heads/try2 c: 675c272 h: refs/heads/master v: v3
1 parent 68f43cc commit c251950

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: b7872fa13eb561956455eefbb06a63411cb4ad14
8+
refs/heads/try2: 675c272dadc8cd7e529fda64904c87e8243fe94f
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/src/rustc/metadata/encoder.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,9 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: ebml::Serializer,
556556
}
557557
let add_to_index = |copy ebml_w| add_to_index_(item, ebml_w, index);
558558

559+
debug!("encoding info for item at %s",
560+
syntax::codemap::span_to_str(item.span, ecx.tcx.sess.codemap));
561+
559562
match item.node {
560563
item_const(_, _) => {
561564
add_to_index();
@@ -738,7 +741,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: ebml::Serializer,
738741
}
739742
}
740743
do opt_trait.iter() |associated_trait| {
741-
encode_trait_ref(ebml_w, ecx, *associated_trait)
744+
encode_trait_ref(ebml_w, ecx, *associated_trait);
742745
}
743746
encode_path(ecx, ebml_w, path, ast_map::path_name(item.ident));
744747
ebml_w.end_tag();

branches/try2/src/rustc/middle/typeck/collect.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -522,10 +522,20 @@ fn convert(ccx: @crate_ctxt, it: @ast::item) {
522522
region_param: rp,
523523
ty: selfty});
524524

525-
for ms_opt.each |ms| {
526-
let cms = convert_methods(ccx, *ms, rp, i_bounds);
527-
for trait_ref.each |t| {
528-
check_methods_against_trait(ccx, tps, rp, selfty, *t, cms);
525+
match ms_opt {
526+
Some(ref ms) => {
527+
let cms = convert_methods(ccx, *ms, rp, i_bounds);
528+
for trait_ref.each |t| {
529+
check_methods_against_trait(ccx, tps, rp, selfty, *t,
530+
cms);
531+
}
532+
}
533+
None => {
534+
// We still need to instantiate the trait ref here so that
535+
// metadata encoding will find the type.
536+
for trait_ref.each |trait_ref| {
537+
let _ = instantiate_trait_ref(ccx, *trait_ref, rp);
538+
}
529539
}
530540
}
531541
}

0 commit comments

Comments
 (0)