rustc: Split out struct bodies into a separate "struct_def" type in the AST

This commit is contained in:
Patrick Walton
2012-08-07 15:34:07 -07:00
parent 1a6dadad5b
commit deaef48675
15 changed files with 115 additions and 96 deletions

View File

@@ -216,11 +216,11 @@ fn map_item(i: @item, cx: ctx, v: vt) {
extend(cx, i.ident)));
}
}
item_class(tps, traits, items, ctor, dtor) => {
let (_, ms) = ast_util::split_class_items(items);
item_class(struct_def, _) => {
let (_, ms) = ast_util::split_class_items(struct_def.members);
// Map trait refs to their parent classes. This is
// so we can find the self_ty
for traits.each |p| {
for struct_def.traits.each |p| {
cx.map.insert(p.ref_id, node_item(i, item_path));
// This is so we can look up the right things when
// encoding/decoding