Skip to content

Commit c98633b

Browse files
committed
---
yaml --- r: 83629 b: refs/heads/try c: 76d92c5 h: refs/heads/master i: 83627: b2a7851 v: v3
1 parent 9b430e4 commit c98633b

File tree

6 files changed

+31
-14
lines changed

6 files changed

+31
-14
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0e4d1fc8cae42e15e00f71d9f439b01bb25a86ae
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
5-
refs/heads/try: 7f9b91856229262540d06f2bcf7ef63a7137a6da
5+
refs/heads/try: 76d92c547288d5b9a39789868465bb83e0bcead2
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/metadata/encoder.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,8 @@ fn encode_info_for_struct_ctor(ecx: &EncodeContext,
747747
path: &[ast_map::path_elt],
748748
name: ast::Ident,
749749
ctor_id: NodeId,
750-
index: @mut ~[entry<i64>]) {
750+
index: @mut ~[entry<i64>],
751+
struct_id: NodeId) {
751752
index.push(entry { val: ctor_id as i64, pos: ebml_w.writer.tell() });
752753

753754
ebml_w.start_tag(tag_items_data_item);
@@ -756,6 +757,7 @@ fn encode_info_for_struct_ctor(ecx: &EncodeContext,
756757
encode_name(ecx, ebml_w, name);
757758
encode_type(ecx, ebml_w, node_id_to_type(ecx.tcx, ctor_id));
758759
encode_path(ecx, ebml_w, path, ast_map::path_name(name));
760+
encode_parent_item(ebml_w, local_def(struct_id));
759761

760762
if ecx.item_symbols.contains_key(&ctor_id) {
761763
encode_symbol(ecx, ebml_w, ctor_id);
@@ -1032,6 +1034,8 @@ fn encode_info_for_item(ecx: &EncodeContext,
10321034
needs to know*/
10331035
encode_struct_fields(ecx, ebml_w, struct_def);
10341036

1037+
(ecx.encode_inlined_item)(ecx, ebml_w, path, ii_item(item));
1038+
10351039
// Encode inherent implementations for this structure.
10361040
encode_inherent_implementations(ecx, ebml_w, def_id);
10371041

@@ -1054,7 +1058,8 @@ fn encode_info_for_item(ecx: &EncodeContext,
10541058
path,
10551059
item.ident,
10561060
ctor_id,
1057-
index);
1061+
index,
1062+
def_id.node);
10581063
}
10591064
}
10601065
item_impl(_, ref opt_trait, ref ty, ref ast_methods) => {

branches/try/src/librustc/middle/trans/inline.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,17 @@ pub fn maybe_instantiate_inline(ccx: @mut CrateContext, fn_id: ast::DefId)
9999
ccx.external.insert(there.id, Some(here.id.node));
100100
}
101101
}
102+
ast::item_struct(ref struct_def, _) => {
103+
match struct_def.ctor_id {
104+
None => {}
105+
Some(ctor_id) => {
106+
let _ = ccx.external.insert(fn_id, Some(ctor_id));
107+
my_id = ctor_id;
108+
}
109+
}
110+
}
102111
_ => ccx.sess.bug("maybe_instantiate_inline: item has a \
103-
non-enum parent")
112+
non-enum, non-struct parent")
104113
}
105114
trans_item(ccx, item);
106115
local_def(my_id)

branches/try/src/libsyntax/ast_map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,9 @@ pub fn map_decoded_item(diag: @mut span_handler,
403403
diag: diag,
404404
};
405405

406-
// methods get added to the AST map when their impl is visited. Since we
406+
// Methods get added to the AST map when their impl is visited. Since we
407407
// don't decode and instantiate the impl, but just the method, we have to
408-
// add it to the table now:
408+
// add it to the table now. Likewise with foreign items.
409409
match *ii {
410410
ii_item(*) => {} // fallthrough
411411
ii_foreign(i) => {

branches/try/src/libsyntax/ast_util.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,17 @@ impl Visitor<()> for IdVisitor {
590590
self.operation.visit_id(struct_field.node.id);
591591
visit::walk_struct_field(self, struct_field, env)
592592
}
593+
594+
fn visit_struct_def(&mut self,
595+
struct_def: @struct_def,
596+
ident: ast::Ident,
597+
generics: &ast::Generics,
598+
id: NodeId,
599+
_: ()) {
600+
self.operation.visit_id(id);
601+
struct_def.ctor_id.map(|&ctor_id| self.operation.visit_id(ctor_id));
602+
visit::walk_struct_def(self, struct_def, ident, generics, id, ());
603+
}
593604
}
594605

595606
pub fn visit_ids_for_inlined_item(item: &inlined_item,

branches/try/src/snapshots.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
S 2013-10-01 320af9b
2-
freebsd-x86_64 a228e126beacd282bf64dfea972775e4bbf0f2cb
3-
linux-i386 5ea6415f07001dfe628009059fe84621ded9569e
4-
linux-x86_64 bbac91f2eb5159bd902308a0965e6f2979d7ccb6
5-
macos-i386 c1e3b891c992ec02275e85f395946169b02df1de
6-
macos-x86_64 2a809e8b7348b7224ff1b572757b0cca87d0e334
7-
winnt-i386 259631c32644fcf0aa96ac8497d44586c70dc50d
8-
91
S 2013-09-26 1434b4b
102
freebsd-x86_64 e0493c3b79e71487452dfb2155d6c972ca6c5822
113
linux-i386 9b38e3773c097656549a109b01589e057abf23a7

0 commit comments

Comments
 (0)