Skip to content

Commit 34fd95d

Browse files
committed
---
yaml --- r: 30045 b: refs/heads/incoming c: 0f996f7 h: refs/heads/master i: 30043: d6cd3ff v: v3
1 parent fa9507f commit 34fd95d

File tree

28 files changed

+209
-193
lines changed

28 files changed

+209
-193
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: 34886ed488f6cc18c3fdc20cdeccab6178e00c0f
9+
refs/heads/incoming: 0f996f70a632d1427801f20935a69a57fbb3679e
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libsyntax/ast.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ type ty_field_ = {ident: ident, mt: mt};
531531
type ty_field = spanned<ty_field_>;
532532

533533
#[auto_serialize]
534-
type ty_method = {ident: ident, attrs: ~[attribute],
534+
type ty_method = {ident: ident, attrs: ~[attribute], purity: purity,
535535
decl: fn_decl, tps: ~[ty_param], self_ty: self_ty,
536536
id: node_id, span: span};
537537

@@ -582,7 +582,7 @@ enum ty_ {
582582
ty_ptr(mt),
583583
ty_rptr(@region, mt),
584584
ty_rec(~[ty_field]),
585-
ty_fn(proto, @~[ty_param_bound], fn_decl),
585+
ty_fn(proto, purity, @~[ty_param_bound], fn_decl),
586586
ty_tup(~[@ty]),
587587
ty_path(@path, node_id),
588588
ty_fixed_length(@ty, option<uint>),
@@ -600,7 +600,6 @@ type arg = {mode: mode, ty: @ty, ident: ident, id: node_id};
600600
type fn_decl =
601601
{inputs: ~[arg],
602602
output: @ty,
603-
purity: purity,
604603
cf: ret_style};
605604

606605
#[auto_serialize]
@@ -633,7 +632,8 @@ type self_ty = spanned<self_ty_>;
633632

634633
#[auto_serialize]
635634
type method = {ident: ident, attrs: ~[attribute],
636-
tps: ~[ty_param], self_ty: self_ty, decl: fn_decl, body: blk,
635+
tps: ~[ty_param], self_ty: self_ty,
636+
purity: purity, decl: fn_decl, body: blk,
637637
id: node_id, span: span, self_id: node_id,
638638
vis: visibility}; // always public, unless it's a
639639
// class method
@@ -775,7 +775,7 @@ type item = {ident: ident, attrs: ~[attribute],
775775
#[auto_serialize]
776776
enum item_ {
777777
item_const(@ty, @expr),
778-
item_fn(fn_decl, ~[ty_param], blk),
778+
item_fn(fn_decl, purity, ~[ty_param], blk),
779779
item_mod(_mod),
780780
item_foreign_mod(foreign_mod),
781781
item_ty(@ty, ~[ty_param]),
@@ -821,7 +821,7 @@ type foreign_item =
821821

822822
#[auto_serialize]
823823
enum foreign_item_ {
824-
foreign_item_fn(fn_decl, ~[ty_param]),
824+
foreign_item_fn(fn_decl, purity, ~[ty_param]),
825825
}
826826

827827
// The data we save and restore about an inlined item or method. This is not

branches/incoming/src/libsyntax/ast_util.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ fn trait_method_to_ty_method(method: trait_method) -> ty_method {
311311
required(m) => m,
312312
provided(m) => {
313313
{ident: m.ident, attrs: m.attrs,
314-
decl: m.decl, tps: m.tps, self_ty: m.self_ty,
314+
purity: m.purity, decl: m.decl,
315+
tps: m.tps, self_ty: m.self_ty,
315316
id: m.id, span: m.span}
316317
}
317318
}
@@ -411,7 +412,7 @@ fn dtor_dec() -> fn_decl {
411412
{inputs: ~[{mode: ast::expl(ast::by_ref),
412413
ty: nil_t, ident: parse::token::special_idents::underscore,
413414
id: 0}],
414-
output: nil_t, purity: impure_fn, cf: return_val}
415+
output: nil_t, cf: return_val}
415416
}
416417

417418
// ______________________________________________________________________
@@ -515,7 +516,7 @@ fn id_visitor(vfn: fn@(node_id)) -> visit::vt<()> {
515516
vfn(self_id);
516517
vfn(parent_id.node);
517518
}
518-
visit::fk_item_fn(_, tps) => {
519+
visit::fk_item_fn(_, tps, _) => {
519520
vec::iter(tps, |tp| vfn(tp.id));
520521
}
521522
visit::fk_method(_, tps, m) => {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,10 @@ impl ext_ctxt: ext_ctxt_helpers {
191191

192192
@{id: self.next_id(),
193193
node: ast::ty_fn(ast::proto_block,
194+
ast::impure_fn,
194195
@~[],
195196
{inputs: args,
196197
output: output,
197-
purity: ast::impure_fn,
198198
cf: ast::return_val}),
199199
span: span}
200200
}
@@ -604,8 +604,8 @@ fn mk_ser_fn(cx: ext_ctxt, span: span, name: ast::ident,
604604
id: cx.next_id(),
605605
node: ast::item_fn({inputs: ser_inputs,
606606
output: ser_output,
607-
purity: ast::impure_fn,
608607
cf: ast::return_val},
608+
ast::impure_fn,
609609
ser_tps,
610610
ser_blk),
611611
vis: ast::public,
@@ -810,8 +810,8 @@ fn mk_deser_fn(cx: ext_ctxt, span: span,
810810
id: cx.next_id(),
811811
node: ast::item_fn({inputs: deser_inputs,
812812
output: v_ty,
813-
purity: ast::impure_fn,
814813
cf: ast::return_val},
814+
ast::impure_fn,
815815
deser_tps,
816816
deser_blk),
817817
vis: ast::public,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ impl ext_ctxt: ext_ctxt_ast_builder {
203203
output: @ast::ty) -> ast::fn_decl {
204204
{inputs: inputs,
205205
output: output,
206-
purity: ast::impure_fn,
207206
cf: ast::return_val}
208207
}
209208

@@ -226,6 +225,7 @@ impl ext_ctxt: ext_ctxt_ast_builder {
226225
self.item(name,
227226
self.empty_span(),
228227
ast::item_fn(self.fn_decl(inputs, output),
228+
ast::impure_fn,
229229
ty_params,
230230
body))
231231
}

branches/incoming/src/libsyntax/fold.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ fn fold_mac_(m: mac, fld: ast_fold) -> mac {
127127
fn fold_fn_decl(decl: ast::fn_decl, fld: ast_fold) -> ast::fn_decl {
128128
return {inputs: vec::map(decl.inputs, |x| fold_arg_(x, fld) ),
129129
output: fld.fold_ty(decl.output),
130-
purity: decl.purity,
131130
cf: decl.cf}
132131
}
133132

@@ -190,12 +189,12 @@ fn noop_fold_foreign_item(&&ni: @foreign_item, fld: ast_fold)
190189
attrs: vec::map(ni.attrs, fold_attribute),
191190
node:
192191
match ni.node {
193-
foreign_item_fn(fdec, typms) => {
192+
foreign_item_fn(fdec, purity, typms) => {
194193
foreign_item_fn({inputs: vec::map(fdec.inputs, fold_arg),
195-
output: fld.fold_ty(fdec.output),
196-
purity: fdec.purity,
197-
cf: fdec.cf},
198-
fold_ty_params(typms, fld))
194+
output: fld.fold_ty(fdec.output),
195+
cf: fdec.cf},
196+
purity,
197+
fold_ty_params(typms, fld))
199198
}
200199
},
201200
id: fld.new_id(ni.id),
@@ -224,8 +223,9 @@ fn noop_fold_struct_field(&&sf: @struct_field, fld: ast_fold)
224223
fn noop_fold_item_underscore(i: item_, fld: ast_fold) -> item_ {
225224
return match i {
226225
item_const(t, e) => item_const(fld.fold_ty(t), fld.fold_expr(e)),
227-
item_fn(decl, typms, body) => {
226+
item_fn(decl, purity, typms, body) => {
228227
item_fn(fold_fn_decl(decl, fld),
228+
purity,
229229
fold_ty_params(typms, fld),
230230
fld.fold_block(body))
231231
}
@@ -314,6 +314,7 @@ fn noop_fold_method(&&m: @method, fld: ast_fold) -> @method {
314314
attrs: /* FIXME (#2543) */ copy m.attrs,
315315
tps: fold_ty_params(m.tps, fld),
316316
self_ty: m.self_ty,
317+
purity: m.purity,
317318
decl: fold_fn_decl(m.decl, fld),
318319
body: fld.fold_block(m.body),
319320
id: fld.new_id(m.id),
@@ -531,10 +532,11 @@ fn noop_fold_ty(t: ty_, fld: ast_fold) -> ty_ {
531532
ty_ptr(mt) => ty_ptr(fold_mt(mt, fld)),
532533
ty_rptr(region, mt) => ty_rptr(region, fold_mt(mt, fld)),
533534
ty_rec(fields) => ty_rec(vec::map(fields, |f| fold_field(f, fld))),
534-
ty_fn(proto, bounds, decl) =>
535-
ty_fn(proto, @vec::map(*bounds,
536-
|x| fold_ty_param_bound(x, fld)),
537-
fold_fn_decl(decl, fld)),
535+
ty_fn(proto, purity, bounds, decl) =>
536+
ty_fn(proto, purity,
537+
@vec::map(*bounds,
538+
|x| fold_ty_param_bound(x, fld)),
539+
fold_fn_decl(decl, fld)),
538540
ty_tup(tys) => ty_tup(vec::map(tys, |ty| fld.fold_ty(ty))),
539541
ty_path(path, id) => ty_path(fld.fold_path(path), fld.new_id(id)),
540542
ty_fixed_length(t, vs) => ty_fixed_length(fld.fold_ty(t), vs),

0 commit comments

Comments
 (0)