rustc: Box struct_defs

This commit is contained in:
Patrick Walton 2012-08-07 17:46:07 -07:00
parent 175be53e3f
commit 438765da59
13 changed files with 21 additions and 21 deletions

View file

@ -736,7 +736,7 @@ enum item_ {
item_foreign_mod(foreign_mod),
item_ty(@ty, ~[ty_param]),
item_enum(~[variant], ~[ty_param]),
item_class(struct_def, ~[ty_param]),
item_class(@struct_def, ~[ty_param]),
item_trait(~[ty_param], ~[@trait_ref], ~[trait_method]),
item_impl(~[ty_param],
~[@trait_ref], /* traits this impl implements */

View file

@ -247,7 +247,7 @@ fn map_item(i: @item, cx: ctx, v: vt) {
vec::pop(cx.path);
}
fn map_struct_def(struct_def: ast::struct_def, parent_node: ast_node,
fn map_struct_def(struct_def: @ast::struct_def, parent_node: ast_node,
ident: ast::ident, id: ast::node_id, cx: ctx, _v: vt) {
let (_, ms) = ast_util::split_class_items(struct_def.members);
// Map trait refs to their parent classes. This is

View file

@ -565,7 +565,7 @@ fn id_visitor(vfn: fn@(node_id)) -> visit::vt<()> {
visit_trait_method: fn@(_ty_m: trait_method) {
},
visit_struct_def: fn@(_sd: struct_def, _id: ident, _tps: ~[ty_param],
visit_struct_def: fn@(_sd: @struct_def, _id: ident, _tps: ~[ty_param],
_id: node_id) {
},

View file

@ -266,7 +266,7 @@ fn noop_fold_item_underscore(i: item_, fld: ast_fold) -> item_ {
{node: {body: dtor_body,
id: dtor_id with dtor.node}
with dtor}};
item_class({
item_class(@{
traits: vec::map(struct_def.traits,
|p| fold_trait_ref(p, fld)),
members: vec::map(struct_def.members,

View file

@ -2598,7 +2598,7 @@ class parser {
match the_ctor {
some((ct_d, ct_attrs, ct_b, ct_s)) => {
(class_name,
item_class({
item_class(@{
traits: traits,
members: ms,
ctor: some({
@ -2614,7 +2614,7 @@ class parser {
}
none => {
(class_name,
item_class({
item_class(@{
traits: traits,
members: ms,
ctor: none,

View file

@ -582,7 +582,7 @@ fn print_item(s: ps, &&item: @ast::item) {
s.ann.post(ann_node);
}
fn print_struct(s: ps, struct_def: ast::struct_def, tps: ~[ast::ty_param],
fn print_struct(s: ps, struct_def: @ast::struct_def, tps: ~[ast::ty_param],
ident: ast::ident, span: ast::span) {
word_nbsp(s, *ident);
print_type_params(s, tps);

View file

@ -61,7 +61,7 @@ type visitor<E> =
visit_fn: fn@(fn_kind, fn_decl, blk, span, node_id, E, vt<E>),
visit_ty_method: fn@(ty_method, E, vt<E>),
visit_trait_method: fn@(trait_method, E, vt<E>),
visit_struct_def: fn@(struct_def, ident, ~[ty_param], node_id, E,
visit_struct_def: fn@(@struct_def, ident, ~[ty_param], node_id, E,
vt<E>),
visit_class_item: fn@(@class_member, E, vt<E>)};
@ -83,8 +83,8 @@ fn default_visitor<E>() -> visitor<E> {
visit_fn: |a,b,c,d,e,f,g|visit_fn::<E>(a, b, c, d, e, f, g),
visit_ty_method: |a,b,c|visit_ty_method::<E>(a, b, c),
visit_trait_method: |a,b,c|visit_trait_method::<E>(a, b, c),
visit_struct_def:
|a,b,c,d,e,f|visit_struct_def::<E>(a, b, c, d, e, f),
visit_struct_def: |a,b,c,d,e,f|visit_struct_def::<E>(a, b, c,
d, e, f),
visit_class_item: |a,b,c|visit_class_item::<E>(a, b, c)};
}
@ -318,7 +318,7 @@ fn visit_trait_method<E>(m: trait_method, e: E, v: vt<E>) {
}
}
fn visit_struct_def<E>(sd: struct_def, nm: ast::ident, tps: ~[ty_param],
fn visit_struct_def<E>(sd: @struct_def, nm: ast::ident, tps: ~[ty_param],
id: node_id, e: E, v: vt<E>) {
for sd.members.each |m| {
v.visit_class_item(m, e, v);
@ -479,7 +479,7 @@ type simple_visitor =
visit_fn: fn@(fn_kind, fn_decl, blk, span, node_id),
visit_ty_method: fn@(ty_method),
visit_trait_method: fn@(trait_method),
visit_struct_def: fn@(struct_def, ident, ~[ty_param], node_id),
visit_struct_def: fn@(@struct_def, ident, ~[ty_param], node_id),
visit_class_item: fn@(@class_member)};
fn simple_ignore_ty(_t: @ty) {}
@ -503,7 +503,7 @@ fn default_simple_visitor() -> simple_visitor {
_id: node_id) { },
visit_ty_method: fn@(_m: ty_method) { },
visit_trait_method: fn@(_m: trait_method) { },
visit_struct_def: fn@(_sd: struct_def, _nm: ident,
visit_struct_def: fn@(_sd: @struct_def, _nm: ident,
_tps: ~[ty_param], _id: node_id) { },
visit_class_item: fn@(_c: @class_member) {}
};
@ -572,8 +572,8 @@ fn mk_simple_visitor(v: simple_visitor) -> vt<()> {
f(m);
visit_trait_method(m, e, v);
}
fn v_struct_def(f: fn@(struct_def, ident, ~[ty_param], node_id),
sd: struct_def, nm: ident, tps: ~[ty_param], id: node_id,
fn v_struct_def(f: fn@(@struct_def, ident, ~[ty_param], node_id),
sd: @struct_def, nm: ident, tps: ~[ty_param], id: node_id,
&&e: (), v: vt<()>) {
f(sd, nm, tps, id);
visit_struct_def(sd, nm, tps, id, e, v);

View file

@ -242,7 +242,7 @@ fn encode_module_item_paths(ebml_w: ebml::writer, ecx: @encode_ctxt,
}
fn encode_struct_def(ebml_w: ebml::writer,
struct_def: ast::struct_def,
struct_def: @ast::struct_def,
path: ~[ast::ident],
ident: ast::ident,
&index: ~[entry<~str>]) {

View file

@ -4909,7 +4909,7 @@ fn trans_item(ccx: @crate_ctxt, item: ast::item) {
}
}
fn trans_struct_def(ccx: @crate_ctxt, struct_def: ast::struct_def,
fn trans_struct_def(ccx: @crate_ctxt, struct_def: @ast::struct_def,
tps: ~[ast::ty_param], path: @ast_map::path,
ident: ast::ident, id: ast::node_id) {
if tps.len() == 0u {

View file

@ -2742,7 +2742,7 @@ fn ty_dtor(cx: ctxt, class_id: def_id) -> option<def_id> {
if is_local(class_id) {
match cx.items.find(class_id.node) {
some(ast_map::node_item(@{
node: ast::item_class({ dtor: some(dtor), _ }, _),
node: ast::item_class(@{ dtor: some(dtor), _ }, _),
_
}, _)) =>
some(local_def(dtor.node.id)),

View file

@ -400,7 +400,7 @@ fn check_no_duplicate_fields(tcx: ty::ctxt, fields:
}
fn check_struct(ccx: @crate_ctxt, struct_def: ast::struct_def,
fn check_struct(ccx: @crate_ctxt, struct_def: @ast::struct_def,
id: ast::node_id, span: span) {
let tcx = ccx.tcx;
let class_t = {self_ty: ty::node_id_to_type(tcx, id), node_id: id};

View file

@ -517,7 +517,7 @@ class CoherenceChecker {
}
}
fn create_impl_from_struct(struct_def: ast::struct_def,
fn create_impl_from_struct(struct_def: @ast::struct_def,
ident: ast::ident,
id: node_id)
-> @Impl {

View file

@ -445,7 +445,7 @@ fn convert(ccx: @crate_ctxt, it: @ast::item) {
}
}
fn convert_struct(ccx: @crate_ctxt, rp: bool, struct_def: ast::struct_def,
fn convert_struct(ccx: @crate_ctxt, rp: bool, struct_def: @ast::struct_def,
tps: ~[ast::ty_param], tpt: ty::ty_param_bounds_and_ty,
id: ast::node_id) {
let tcx = ccx.tcx;