Skip to content

Commit b179348

Browse files
committed
---
yaml --- r: 47805 b: refs/heads/incoming c: bc62bd3 h: refs/heads/master i: 47803: ce79d59 v: v3
1 parent 53123c4 commit b179348

File tree

10 files changed

+151
-105
lines changed

10 files changed

+151
-105
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: 59ba4fc1042bb83dc6899462649d70a0141ff8ca
9+
refs/heads/incoming: bc62bd378251d6dd60f2999cd8c853a75a4e8d02
1010
refs/heads/dist-snap: 8b98e5a296d95c5e832db0756828e5bec31c6f50
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libsyntax/ast_map.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ pub fn map_fn(fk: visit::fn_kind, decl: fn_decl, body: blk,
193193
cx.local_id += 1u;
194194
}
195195
match fk {
196-
visit::fk_dtor(tps, ref attrs, self_id, parent_id) => {
196+
visit::fk_dtor(ref tps, ref attrs, self_id, parent_id) => {
197197
let dt = @spanned {
198198
node: ast::struct_dtor_ {
199199
id: id,
@@ -203,7 +203,7 @@ pub fn map_fn(fk: visit::fn_kind, decl: fn_decl, body: blk,
203203
},
204204
span: sp,
205205
};
206-
cx.map.insert(id, node_dtor(/* FIXME (#2543) */ copy tps, dt,
206+
cx.map.insert(id, node_dtor(/* FIXME (#2543) */ copy *tps, dt,
207207
parent_id,
208208
@/* FIXME (#2543) */ copy cx.path));
209209
}
@@ -286,7 +286,7 @@ pub fn map_item(i: @item, &&cx: @mut Ctx, v: vt) {
286286
map_struct_def(struct_def, node_item(i, item_path), i.ident, cx,
287287
v);
288288
}
289-
item_trait(_, traits, ref methods) => {
289+
item_trait(_, ref traits, ref methods) => {
290290
for traits.each |p| {
291291
cx.map.insert(p.ref_id, node_item(i, item_path));
292292
}

branches/incoming/src/libsyntax/ast_util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,8 @@ pub impl inlined_item_utils for inlined_item {
327327
ii_item(i) => (v.visit_item)(i, e, v),
328328
ii_foreign(i) => (v.visit_foreign_item)(i, e, v),
329329
ii_method(_, m) => visit::visit_method_helper(m, e, v),
330-
ii_dtor(ref dtor, _, tps, parent_id) => {
331-
visit::visit_struct_dtor_helper((*dtor), tps, parent_id, e, v);
330+
ii_dtor(/*bad*/ copy dtor, _, /*bad*/ copy tps, parent_id) => {
331+
visit::visit_struct_dtor_helper(dtor, tps, parent_id, e, v);
332332
}
333333
}
334334
}

branches/incoming/src/libsyntax/ext/auto_encode.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -127,24 +127,24 @@ pub fn expand_auto_encode(
127127
do vec::flat_map(in_items) |item| {
128128
if item.attrs.any(is_auto_encode) {
129129
match item.node {
130-
ast::item_struct(@ast::struct_def { fields, _}, tps) => {
130+
ast::item_struct(ref struct_def, ref tps) => {
131131
let ser_impl = mk_struct_ser_impl(
132132
cx,
133133
item.span,
134134
item.ident,
135-
fields,
136-
tps
135+
struct_def.fields,
136+
*tps
137137
);
138138

139139
~[filter_attrs(*item), ser_impl]
140140
},
141-
ast::item_enum(ref enum_def, tps) => {
141+
ast::item_enum(ref enum_def, ref tps) => {
142142
let ser_impl = mk_enum_ser_impl(
143143
cx,
144144
item.span,
145145
item.ident,
146-
(*enum_def),
147-
tps
146+
*enum_def,
147+
*tps
148148
);
149149

150150
~[filter_attrs(*item), ser_impl]
@@ -182,24 +182,24 @@ pub fn expand_auto_decode(
182182
do vec::flat_map(in_items) |item| {
183183
if item.attrs.any(is_auto_decode) {
184184
match item.node {
185-
ast::item_struct(@ast::struct_def { fields, _}, tps) => {
185+
ast::item_struct(ref struct_def, ref tps) => {
186186
let deser_impl = mk_struct_deser_impl(
187187
cx,
188188
item.span,
189189
item.ident,
190-
fields,
191-
tps
190+
struct_def.fields,
191+
*tps
192192
);
193193

194194
~[filter_attrs(*item), deser_impl]
195195
},
196-
ast::item_enum(ref enum_def, tps) => {
196+
ast::item_enum(ref enum_def, ref tps) => {
197197
let deser_impl = mk_enum_deser_impl(
198198
cx,
199199
item.span,
200200
item.ident,
201-
(*enum_def),
202-
tps
201+
*enum_def,
202+
*tps
203203
);
204204

205205
~[filter_attrs(*item), deser_impl]
@@ -410,7 +410,7 @@ fn mk_impl(
410410
ident: ast::ident,
411411
ty_param: ast::ty_param,
412412
path: @ast::path,
413-
tps: ~[ast::ty_param],
413+
tps: &[ast::ty_param],
414414
f: fn(@ast::Ty) -> @ast::method
415415
) -> @ast::item {
416416
// All the type parameters need to bound to the trait.
@@ -458,7 +458,7 @@ fn mk_ser_impl(
458458
cx: ext_ctxt,
459459
span: span,
460460
ident: ast::ident,
461-
tps: ~[ast::ty_param],
461+
tps: &[ast::ty_param],
462462
body: @ast::expr
463463
) -> @ast::item {
464464
// Make a path to the std::serialize::Encodable typaram.
@@ -666,8 +666,8 @@ fn mk_struct_ser_impl(
666666
cx: ext_ctxt,
667667
span: span,
668668
ident: ast::ident,
669-
fields: ~[@ast::struct_field],
670-
tps: ~[ast::ty_param]
669+
fields: &[@ast::struct_field],
670+
tps: &[ast::ty_param]
671671
) -> @ast::item {
672672
let fields = do mk_struct_fields(fields).mapi |idx, field| {
673673
// ast for `|| self.$(name).encode(__s)`
@@ -808,7 +808,7 @@ struct field {
808808
mutbl: ast::mutability,
809809
}
810810

811-
fn mk_struct_fields(fields: ~[@ast::struct_field]) -> ~[field] {
811+
fn mk_struct_fields(fields: &[@ast::struct_field]) -> ~[field] {
812812
do fields.map |field| {
813813
let (ident, mutbl) = match field.node.kind {
814814
ast::named_field(ident, mutbl, _) => (ident, mutbl),

branches/incoming/src/libsyntax/ext/pipes/check.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,27 @@ pub impl proto::visitor<(), (), ()> for ext_ctxt {
5454
fn visit_message(&self, name: ~str, _span: span, _tys: &[@ast::Ty],
5555
this: state, next: Option<next_state>) {
5656
match next {
57-
Some(next_state { state: ref next, tys: next_tys }) => {
57+
Some(ref next_state) => {
5858
let proto = this.proto;
59-
if !proto.has_state((*next)) {
59+
if !proto.has_state(next_state.state) {
6060
// This should be a span fatal, but then we need to
6161
// track span information.
6262
self.span_err(
63-
proto.get_state((*next)).span,
63+
proto.get_state(next_state.state).span,
6464
fmt!("message %s steps to undefined state, %s",
65-
name, (*next)));
65+
name, next_state.state));
6666
}
6767
else {
68-
let next = proto.get_state((*next));
68+
let next = proto.get_state(next_state.state);
6969

70-
if next.ty_params.len() != next_tys.len() {
70+
if next.ty_params.len() != next_state.tys.len() {
7171
self.span_err(
7272
next.span, // use a real span
7373
fmt!("message %s target (%s) \
7474
needs %u type parameters, but got %u",
7575
name, next.name,
7676
next.ty_params.len(),
77-
next_tys.len()));
77+
next_state.tys.len()));
7878
}
7979
}
8080
}

branches/incoming/src/libsyntax/ext/pipes/pipec.rs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,13 @@ pub impl gen_send for message {
5050
fn gen_send(&self, cx: ext_ctxt, try: bool) -> @ast::item {
5151
debug!("pipec: gen_send");
5252
match *self {
53-
message(ref _id, span, tys, this,
54-
Some(next_state {state: ref next, tys: next_tys})) => {
53+
message(ref _id, span, ref tys, this, Some(ref next_state)) => {
5554
debug!("pipec: next state exists");
56-
let next = this.proto.get_state((*next));
57-
assert next_tys.len() == next.ty_params.len();
55+
let next = this.proto.get_state(next_state.state);
56+
assert next_state.tys.len() == next.ty_params.len();
5857
let arg_names = tys.mapi(|i, _ty| cx.ident_of(~"x_"+i.to_str()));
5958

60-
let args_ast = (arg_names, tys).map(
61-
|n, t| cx.arg(*n, *t)
62-
);
59+
let args_ast = (arg_names, *tys).map(|n, t| cx.arg(*n, *t));
6360

6461
let pipe_ty = cx.ty_path_ast_builder(
6562
path(~[this.data_name()], span)
@@ -119,7 +116,7 @@ pub impl gen_send for message {
119116

120117
let mut rty = cx.ty_path_ast_builder(path(~[next.data_name()],
121118
span)
122-
.add_tys(next_tys));
119+
.add_tys(next_state.tys));
123120
if try {
124121
rty = cx.ty_option(rty);
125122
}
@@ -134,13 +131,13 @@ pub impl gen_send for message {
134131
cx.expr_block(body))
135132
}
136133
137-
message(ref _id, span, tys, this, None) => {
134+
message(ref _id, span, ref tys, this, None) => {
138135
debug!("pipec: no next state");
139136
let arg_names = tys.mapi(|i, _ty| (~"x_" + i.to_str()));
140137
141-
let args_ast = (arg_names, tys).map(
142-
|n, t| cx.arg(cx.ident_of(*n), *t)
143-
);
138+
let args_ast = do (arg_names, *tys).map |n, t| {
139+
cx.arg(cx.ident_of(*n), *t)
140+
};
144141
145142
let args_ast = vec::append(
146143
~[cx.arg(cx.ident_of(~"pipe"),
@@ -219,8 +216,8 @@ pub impl to_type_decls for state {
219216
let message(name, span, tys, this, next) = *m;
220217
221218
let tys = match next {
222-
Some(next_state { state: ref next, tys: next_tys }) => {
223-
let next = this.proto.get_state((*next));
219+
Some(ref next_state) => {
220+
let next = this.proto.get_state((next_state.state));
224221
let next_name = cx.str_of(next.data_name());
225222
226223
let dir = match this.dir {
@@ -232,7 +229,7 @@ pub impl to_type_decls for state {
232229
cx.ty_path_ast_builder(
233230
path(~[cx.ident_of(dir),
234231
cx.ident_of(next_name)], span)
235-
.add_tys(next_tys)))
232+
.add_tys(next_state.tys)))
236233
}
237234
None => tys
238235
};

branches/incoming/src/libsyntax/ext/tt/macro_rules.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,13 @@ pub fn add_new_extension(cx: ext_ctxt, sp: span, name: ident,
5959
arg_reader as reader, argument_gram);
6060

6161
// Extract the arguments:
62-
let lhses:~[@named_match] = match argument_map.get(&lhs_nm) {
63-
@matched_seq(s, _) => s,
64-
_ => cx.span_bug(sp, ~"wrong-structured lhs")
62+
let lhses = match argument_map.get(&lhs_nm) {
63+
@matched_seq(ref s, _) => /* FIXME (#2543) */ copy *s,
64+
_ => cx.span_bug(sp, ~"wrong-structured lhs")
6565
};
66-
let rhses:~[@named_match] = match argument_map.get(&rhs_nm) {
67-
@matched_seq(s, _) => s,
66+
67+
let rhses = match argument_map.get(&rhs_nm) {
68+
@matched_seq(ref s, _) => /* FIXME (#2543) */ copy *s,
6869
_ => cx.span_bug(sp, ~"wrong-structured rhs")
6970
};
7071

branches/incoming/src/libsyntax/fold.rs

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ fn fold_meta_item_(&&mi: @meta_item, fld: ast_fold) -> @meta_item {
8282
node:
8383
match mi.node {
8484
meta_word(ref id) => meta_word((*id)),
85-
meta_list(ref id, mis) => {
86-
let fold_meta_item = |x|fold_meta_item_(x, fld);
87-
meta_list(/* FIXME: (#2543) */ copy (*id),
88-
vec::map(mis, |e| fold_meta_item(*e)))
85+
meta_list(ref id, ref mis) => {
86+
let fold_meta_item = |x| fold_meta_item_(x, fld);
87+
meta_list(/* FIXME: (#2543) */ copy *id,
88+
mis.map(|e| fold_meta_item(*e)))
8989
}
9090
meta_name_value(ref id, s) => {
9191
meta_name_value((*id), /* FIXME (#2543) */ copy s)
@@ -215,42 +215,44 @@ fn noop_fold_struct_field(&&sf: @struct_field, fld: ast_fold)
215215
pub fn noop_fold_item_underscore(i: item_, fld: ast_fold) -> item_ {
216216
match i {
217217
item_const(t, e) => item_const(fld.fold_ty(t), fld.fold_expr(e)),
218-
item_fn(decl, purity, typms, ref body) => {
219-
item_fn(fold_fn_decl(decl, fld),
218+
item_fn(ref decl, purity, ref typms, ref body) => {
219+
item_fn(fold_fn_decl(/* FIXME (#2543) */ copy *decl, fld),
220220
purity,
221-
fold_ty_params(typms, fld),
222-
fld.fold_block((*body)))
221+
fold_ty_params(/* FIXME (#2543) */ copy *typms, fld),
222+
fld.fold_block(*body))
223223
}
224224
item_mod(m) => item_mod(fld.fold_mod(m)),
225225
item_foreign_mod(nm) => item_foreign_mod(fld.fold_foreign_mod(nm)),
226226
item_ty(t, typms) => item_ty(fld.fold_ty(t),
227227
fold_ty_params(typms, fld)),
228-
item_enum(ref enum_definition, typms) => {
228+
item_enum(ref enum_definition, ref typms) => {
229229
item_enum(ast::enum_def(ast::enum_def_ {
230230
variants: enum_definition.variants.map(
231231
|x| fld.fold_variant(*x)),
232232
common: enum_definition.common.map(
233233
|x| fold_struct_def(*x, fld)),
234-
}), fold_ty_params(typms, fld))
234+
}), fold_ty_params(/* FIXME (#2543) */ copy *typms, fld))
235235
}
236-
item_struct(struct_def, typms) => {
237-
let struct_def = fold_struct_def(struct_def, fld);
238-
item_struct(struct_def, /* FIXME (#2543) */ copy typms)
236+
item_struct(ref struct_def, ref typms) => {
237+
let struct_def = fold_struct_def(
238+
/* FIXME (#2543) */ copy *struct_def,
239+
fld);
240+
item_struct(struct_def, /* FIXME (#2543) */ copy *typms)
239241
}
240-
item_impl(tps, ifce, ty, ref methods) => {
241-
item_impl(fold_ty_params(tps, fld),
242+
item_impl(ref tps, ifce, ty, ref methods) => {
243+
item_impl(fold_ty_params(/* FIXME (#2543) */ copy *tps, fld),
242244
ifce.map(|p| fold_trait_ref(*p, fld)),
243245
fld.fold_ty(ty),
244246
methods.map(|x| fld.fold_method(*x)))
245247
}
246-
item_trait(tps, traits, ref methods) => {
248+
item_trait(ref tps, ref traits, ref methods) => {
247249
let methods = do methods.map |method| {
248250
match *method {
249251
required(*) => copy *method,
250252
provided(method) => provided(fld.fold_method(method))
251253
}
252254
};
253-
item_trait(fold_ty_params(tps, fld),
255+
item_trait(fold_ty_params(/* FIXME (#2543) */ copy *tps, fld),
254256
traits.map(|p| fold_trait_ref(*p, fld)),
255257
methods)
256258
}
@@ -466,14 +468,14 @@ pub fn noop_fold_expr(e: expr_, fld: ast_fold) -> expr_ {
466468
expr_match(fld.fold_expr(expr),
467469
vec::map((*arms), |x| fld.fold_arm(*x)))
468470
}
469-
expr_fn(proto, decl, ref body, _) => {
471+
expr_fn(proto, ref decl, ref body, _) => {
470472
expr_fn(proto,
471-
fold_fn_decl(decl, fld),
473+
fold_fn_decl(/* FIXME (#2543) */ copy *decl, fld),
472474
fld.fold_block(*body),
473475
@())
474476
}
475-
expr_fn_block(decl, ref body) => {
476-
expr_fn_block(fold_fn_decl(decl, fld),
477+
expr_fn_block(ref decl, ref body) => {
478+
expr_fn_block(fold_fn_decl(/* FIXME (#2543) */ copy *decl, fld),
477479
fld.fold_block(*body))
478480
}
479481
expr_block(ref blk) => expr_block(fld.fold_block((*blk))),

0 commit comments

Comments
 (0)