Skip to content

Commit a781d44

Browse files
committed
---
yaml --- r: 21207 b: refs/heads/snap-stage3 c: 10c997a h: refs/heads/master i: 21205: 4267c30 21203: 74ed1ee 21199: 6d8207c v: v3
1 parent 542957b commit a781d44

File tree

2 files changed

+21
-27
lines changed

2 files changed

+21
-27
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: e430a699f2c60890d9b86069fd0c68a70ece7120
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 1ed94a56744c0ed4056c22da297d84222f4327f2
4+
refs/heads/snap-stage3: 10c997a746178085b6b447a76e237dd08c5446fa
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/rustc/metadata/encoder.rs

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -262,32 +262,26 @@ fn encode_info_for_mod(ecx: @encode_ctxt, ebml_w: ebml::writer, md: _mod,
262262
encode_family(ebml_w, 'm');
263263
encode_name(ebml_w, name);
264264
debug!{"(encoding info for module) encoding info for module ID %d", id};
265-
// the impl map contains ref_ids
266-
let impls = ecx.impl_map(id);
267-
for impls.each |i| {
268-
let (ident, did) = i;
269-
debug!{"(encoding info for module) ... encoding impl %s (%?/%?), \
270-
exported? %?",
271-
*ident,
272-
did,
273-
ast_map::node_id_to_str(ecx.tcx.items, did.node),
274-
ast_util::is_exported(ident, md)};
275-
276-
ebml_w.start_tag(tag_mod_impl);
277-
match ecx.tcx.items.find(did.node) {
278-
some(ast_map::node_item(it@@{node: cl@item_class(*),_},_)) => {
279-
/* If did stands for a trait
280-
ref, we need to map it to its parent class */
281-
ebml_w.wr_str(def_to_str(local_def(it.id)));
282-
}
283-
_ => {
284-
// Must be a re-export, then!
285-
// ...or a trait ref
286-
ebml_w.wr_str(def_to_str(did));
287-
}
288-
};
289-
ebml_w.end_tag();
290-
} // for
265+
266+
// Encode info about all the module children.
267+
for md.items.each |item| {
268+
match item.node {
269+
item_impl(*) | item_class(*) => {
270+
let (ident, did) = (item.ident, item.id);
271+
debug!{"(encoding info for module) ... encoding impl %s \
272+
(%?/%?), exported? %?",
273+
*ident,
274+
did,
275+
ast_map::node_id_to_str(ecx.tcx.items, did),
276+
ast_util::is_exported(ident, md)};
277+
278+
ebml_w.start_tag(tag_mod_impl);
279+
ebml_w.wr_str(def_to_str(local_def(did)));
280+
ebml_w.end_tag();
281+
}
282+
_ => {} // XXX: Encode these too.
283+
}
284+
}
291285

292286
encode_path(ebml_w, path, ast_map::path_mod(name));
293287

0 commit comments

Comments
 (0)