Skip to content

Commit 4812672

Browse files
committed
rustc: Make trans no longer insist that there be exactly one impl scope per module
Conflicts: src/rustc/middle/trans/base.rs
1 parent 1228c55 commit 4812672

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/rustc/middle/trans/base.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5456,17 +5456,12 @@ fn crate_ctxt_to_encode_parms(cx: @crate_ctxt)
54565456

54575457
fn impl_map(cx: @crate_ctxt,
54585458
id: ast::node_id) -> [(ast::ident, ast::def_id)]/~ {
5459-
alt *cx.maps.impl_map.get(id) {
5460-
list::cons(impls, @list::nil) {
5461-
(*impls).map {|i|
5462-
(i.ident, i.did)
5463-
}
5464-
}
5465-
_ {
5466-
cx.sess.bug(#fmt("encode_info_for_mod: empty impl_map \
5467-
entry for %?", id));
5468-
}
5459+
let mut result = []/~;
5460+
for list::each(cx.maps.impl_map.get(id)) {
5461+
|impls|
5462+
result += (*impls).map({|i| (i.ident, i.did) });
54695463
}
5464+
ret result;
54705465
}
54715466
}
54725467

0 commit comments

Comments
 (0)