Skip to content

Commit 438765d

Browse files
committed
rustc: Box struct_defs
1 parent 175be53 commit 438765d

File tree

13 files changed

+21
-21
lines changed

13 files changed

+21
-21
lines changed

src/libsyntax/ast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ enum item_ {
736736
item_foreign_mod(foreign_mod),
737737
item_ty(@ty, ~[ty_param]),
738738
item_enum(~[variant], ~[ty_param]),
739-
item_class(struct_def, ~[ty_param]),
739+
item_class(@struct_def, ~[ty_param]),
740740
item_trait(~[ty_param], ~[@trait_ref], ~[trait_method]),
741741
item_impl(~[ty_param],
742742
~[@trait_ref], /* traits this impl implements */

src/libsyntax/ast_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ fn map_item(i: @item, cx: ctx, v: vt) {
247247
vec::pop(cx.path);
248248
}
249249

250-
fn map_struct_def(struct_def: ast::struct_def, parent_node: ast_node,
250+
fn map_struct_def(struct_def: @ast::struct_def, parent_node: ast_node,
251251
ident: ast::ident, id: ast::node_id, cx: ctx, _v: vt) {
252252
let (_, ms) = ast_util::split_class_items(struct_def.members);
253253
// Map trait refs to their parent classes. This is

src/libsyntax/ast_util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ fn id_visitor(vfn: fn@(node_id)) -> visit::vt<()> {
565565
visit_trait_method: fn@(_ty_m: trait_method) {
566566
},
567567

568-
visit_struct_def: fn@(_sd: struct_def, _id: ident, _tps: ~[ty_param],
568+
visit_struct_def: fn@(_sd: @struct_def, _id: ident, _tps: ~[ty_param],
569569
_id: node_id) {
570570
},
571571

src/libsyntax/fold.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ fn noop_fold_item_underscore(i: item_, fld: ast_fold) -> item_ {
266266
{node: {body: dtor_body,
267267
id: dtor_id with dtor.node}
268268
with dtor}};
269-
item_class({
269+
item_class(@{
270270
traits: vec::map(struct_def.traits,
271271
|p| fold_trait_ref(p, fld)),
272272
members: vec::map(struct_def.members,

src/libsyntax/parse/parser.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2598,7 +2598,7 @@ class parser {
25982598
match the_ctor {
25992599
some((ct_d, ct_attrs, ct_b, ct_s)) => {
26002600
(class_name,
2601-
item_class({
2601+
item_class(@{
26022602
traits: traits,
26032603
members: ms,
26042604
ctor: some({
@@ -2614,7 +2614,7 @@ class parser {
26142614
}
26152615
none => {
26162616
(class_name,
2617-
item_class({
2617+
item_class(@{
26182618
traits: traits,
26192619
members: ms,
26202620
ctor: none,

src/libsyntax/print/pprust.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ fn print_item(s: ps, &&item: @ast::item) {
582582
s.ann.post(ann_node);
583583
}
584584

585-
fn print_struct(s: ps, struct_def: ast::struct_def, tps: ~[ast::ty_param],
585+
fn print_struct(s: ps, struct_def: @ast::struct_def, tps: ~[ast::ty_param],
586586
ident: ast::ident, span: ast::span) {
587587
word_nbsp(s, *ident);
588588
print_type_params(s, tps);

src/libsyntax/visit.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ type visitor<E> =
6161
visit_fn: fn@(fn_kind, fn_decl, blk, span, node_id, E, vt<E>),
6262
visit_ty_method: fn@(ty_method, E, vt<E>),
6363
visit_trait_method: fn@(trait_method, E, vt<E>),
64-
visit_struct_def: fn@(struct_def, ident, ~[ty_param], node_id, E,
64+
visit_struct_def: fn@(@struct_def, ident, ~[ty_param], node_id, E,
6565
vt<E>),
6666
visit_class_item: fn@(@class_member, E, vt<E>)};
6767

@@ -83,8 +83,8 @@ fn default_visitor<E>() -> visitor<E> {
8383
visit_fn: |a,b,c,d,e,f,g|visit_fn::<E>(a, b, c, d, e, f, g),
8484
visit_ty_method: |a,b,c|visit_ty_method::<E>(a, b, c),
8585
visit_trait_method: |a,b,c|visit_trait_method::<E>(a, b, c),
86-
visit_struct_def:
87-
|a,b,c,d,e,f|visit_struct_def::<E>(a, b, c, d, e, f),
86+
visit_struct_def: |a,b,c,d,e,f|visit_struct_def::<E>(a, b, c,
87+
d, e, f),
8888
visit_class_item: |a,b,c|visit_class_item::<E>(a, b, c)};
8989
}
9090

@@ -318,7 +318,7 @@ fn visit_trait_method<E>(m: trait_method, e: E, v: vt<E>) {
318318
}
319319
}
320320

321-
fn visit_struct_def<E>(sd: struct_def, nm: ast::ident, tps: ~[ty_param],
321+
fn visit_struct_def<E>(sd: @struct_def, nm: ast::ident, tps: ~[ty_param],
322322
id: node_id, e: E, v: vt<E>) {
323323
for sd.members.each |m| {
324324
v.visit_class_item(m, e, v);
@@ -479,7 +479,7 @@ type simple_visitor =
479479
visit_fn: fn@(fn_kind, fn_decl, blk, span, node_id),
480480
visit_ty_method: fn@(ty_method),
481481
visit_trait_method: fn@(trait_method),
482-
visit_struct_def: fn@(struct_def, ident, ~[ty_param], node_id),
482+
visit_struct_def: fn@(@struct_def, ident, ~[ty_param], node_id),
483483
visit_class_item: fn@(@class_member)};
484484

485485
fn simple_ignore_ty(_t: @ty) {}
@@ -503,7 +503,7 @@ fn default_simple_visitor() -> simple_visitor {
503503
_id: node_id) { },
504504
visit_ty_method: fn@(_m: ty_method) { },
505505
visit_trait_method: fn@(_m: trait_method) { },
506-
visit_struct_def: fn@(_sd: struct_def, _nm: ident,
506+
visit_struct_def: fn@(_sd: @struct_def, _nm: ident,
507507
_tps: ~[ty_param], _id: node_id) { },
508508
visit_class_item: fn@(_c: @class_member) {}
509509
};
@@ -572,8 +572,8 @@ fn mk_simple_visitor(v: simple_visitor) -> vt<()> {
572572
f(m);
573573
visit_trait_method(m, e, v);
574574
}
575-
fn v_struct_def(f: fn@(struct_def, ident, ~[ty_param], node_id),
576-
sd: struct_def, nm: ident, tps: ~[ty_param], id: node_id,
575+
fn v_struct_def(f: fn@(@struct_def, ident, ~[ty_param], node_id),
576+
sd: @struct_def, nm: ident, tps: ~[ty_param], id: node_id,
577577
&&e: (), v: vt<()>) {
578578
f(sd, nm, tps, id);
579579
visit_struct_def(sd, nm, tps, id, e, v);

src/rustc/metadata/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ fn encode_module_item_paths(ebml_w: ebml::writer, ecx: @encode_ctxt,
242242
}
243243

244244
fn encode_struct_def(ebml_w: ebml::writer,
245-
struct_def: ast::struct_def,
245+
struct_def: @ast::struct_def,
246246
path: ~[ast::ident],
247247
ident: ast::ident,
248248
&index: ~[entry<~str>]) {

src/rustc/middle/trans/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4909,7 +4909,7 @@ fn trans_item(ccx: @crate_ctxt, item: ast::item) {
49094909
}
49104910
}
49114911

4912-
fn trans_struct_def(ccx: @crate_ctxt, struct_def: ast::struct_def,
4912+
fn trans_struct_def(ccx: @crate_ctxt, struct_def: @ast::struct_def,
49134913
tps: ~[ast::ty_param], path: @ast_map::path,
49144914
ident: ast::ident, id: ast::node_id) {
49154915
if tps.len() == 0u {

src/rustc/middle/ty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2742,7 +2742,7 @@ fn ty_dtor(cx: ctxt, class_id: def_id) -> option<def_id> {
27422742
if is_local(class_id) {
27432743
match cx.items.find(class_id.node) {
27442744
some(ast_map::node_item(@{
2745-
node: ast::item_class({ dtor: some(dtor), _ }, _),
2745+
node: ast::item_class(@{ dtor: some(dtor), _ }, _),
27462746
_
27472747
}, _)) =>
27482748
some(local_def(dtor.node.id)),

src/rustc/middle/typeck/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ fn check_no_duplicate_fields(tcx: ty::ctxt, fields:
400400

401401
}
402402

403-
fn check_struct(ccx: @crate_ctxt, struct_def: ast::struct_def,
403+
fn check_struct(ccx: @crate_ctxt, struct_def: @ast::struct_def,
404404
id: ast::node_id, span: span) {
405405
let tcx = ccx.tcx;
406406
let class_t = {self_ty: ty::node_id_to_type(tcx, id), node_id: id};

src/rustc/middle/typeck/coherence.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ class CoherenceChecker {
517517
}
518518
}
519519

520-
fn create_impl_from_struct(struct_def: ast::struct_def,
520+
fn create_impl_from_struct(struct_def: @ast::struct_def,
521521
ident: ast::ident,
522522
id: node_id)
523523
-> @Impl {

src/rustc/middle/typeck/collect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ fn convert(ccx: @crate_ctxt, it: @ast::item) {
445445
}
446446
}
447447

448-
fn convert_struct(ccx: @crate_ctxt, rp: bool, struct_def: ast::struct_def,
448+
fn convert_struct(ccx: @crate_ctxt, rp: bool, struct_def: @ast::struct_def,
449449
tps: ~[ast::ty_param], tpt: ty::ty_param_bounds_and_ty,
450450
id: ast::node_id) {
451451
let tcx = ccx.tcx;

0 commit comments

Comments
 (0)