Skip to content

Commit a79f053

Browse files
committed
---
yaml --- r: 149109 b: refs/heads/try2 c: 7ba5bef h: refs/heads/master i: 149107: 52c6cfe v: v3
1 parent 6421147 commit a79f053

File tree

2 files changed

+8
-19
lines changed

2 files changed

+8
-19
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: ca65c00ef2e1fb7373c97085315703887ee4d53c
8+
refs/heads/try2: 7ba5bef86e9939accea4c4a12c4c10e5723a773c
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libsyntax/fold.rs

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,12 @@ pub trait Folder {
7575
}
7676

7777
fn fold_struct_field(&mut self, sf: &StructField) -> StructField {
78-
let fold_attribute = |x| fold_attribute_(x, self);
79-
8078
Spanned {
8179
node: ast::StructField_ {
8280
kind: sf.node.kind,
8381
id: self.new_id(sf.node.id),
8482
ty: self.fold_ty(sf.node.ty),
85-
attrs: sf.node.attrs.map(|e| fold_attribute(*e))
83+
attrs: sf.node.attrs.map(|e| fold_attribute_(*e, self))
8684
},
8785
span: self.new_span(sf.span)
8886
}
@@ -225,8 +223,7 @@ pub trait Folder {
225223
}
226224
}
227225

228-
let fold_attribute = |x| fold_attribute_(x, self);
229-
let attrs = v.node.attrs.map(|x| fold_attribute(*x));
226+
let attrs = v.node.attrs.map(|x| fold_attribute_(*x, self));
230227

231228
let de = match v.node.disr_expr {
232229
Some(e) => Some(self.fold_expr(e)),
@@ -323,8 +320,7 @@ fn fold_meta_item_<T: Folder>(mi: @MetaItem, fld: &mut T) -> @MetaItem {
323320
match mi.node {
324321
MetaWord(ref id) => MetaWord((*id).clone()),
325322
MetaList(ref id, ref mis) => {
326-
let fold_meta_item = |x| fold_meta_item_(x, fld);
327-
MetaList((*id).clone(), mis.map(|e| fold_meta_item(*e)))
323+
MetaList((*id).clone(), mis.map(|e| fold_meta_item_(*e, fld)))
328324
}
329325
MetaNameValue(ref id, ref s) => {
330326
MetaNameValue((*id).clone(), (*s).clone())
@@ -604,23 +600,18 @@ pub fn noop_fold_mod<T: Folder>(m: &Mod, folder: &mut T) -> Mod {
604600
}
605601

606602
pub fn noop_fold_crate<T: Folder>(c: Crate, folder: &mut T) -> Crate {
607-
let fold_meta_item = |x| fold_meta_item_(x, folder);
608-
let fold_attribute = |x| fold_attribute_(x, folder);
609-
610603
Crate {
611604
module: folder.fold_mod(&c.module),
612-
attrs: c.attrs.map(|x| fold_attribute(*x)),
613-
config: c.config.map(|x| fold_meta_item(*x)),
605+
attrs: c.attrs.map(|x| fold_attribute_(*x, folder)),
606+
config: c.config.map(|x| fold_meta_item_(*x, folder)),
614607
span: folder.new_span(c.span),
615608
}
616609
}
617610

618611
pub fn noop_fold_item<T: Folder>(i: &Item, folder: &mut T) -> SmallVector<@Item> {
619-
let fold_attribute = |x| fold_attribute_(x, folder);
620-
621612
SmallVector::one(@Item {
622613
ident: folder.fold_ident(i.ident),
623-
attrs: i.attrs.map(|e| fold_attribute(*e)),
614+
attrs: i.attrs.map(|e| fold_attribute_(*e, folder)),
624615
id: folder.new_id(i.id),
625616
node: folder.fold_item_underscore(&i.node),
626617
vis: i.vis,
@@ -711,8 +702,6 @@ pub fn noop_fold_pat<T: Folder>(p: @Pat, folder: &mut T) -> @Pat {
711702
}
712703

713704
pub fn noop_fold_expr<T: Folder>(e: @Expr, folder: &mut T) -> @Expr {
714-
let fold_field = |x| fold_field_(x, folder);
715-
716705
let node = match e.node {
717706
ExprVstore(e, v) => {
718707
ExprVstore(folder.fold_expr(e), v)
@@ -824,7 +813,7 @@ pub fn noop_fold_expr<T: Folder>(e: @Expr, folder: &mut T) -> @Expr {
824813
ExprMac(ref mac) => ExprMac(folder.fold_mac(mac)),
825814
ExprStruct(ref path, ref fields, maybe_expr) => {
826815
ExprStruct(folder.fold_path(path),
827-
fields.map(|x| fold_field(*x)),
816+
fields.map(|x| fold_field_(*x, folder)),
828817
maybe_expr.map(|x| folder.fold_expr(x)))
829818
},
830819
ExprParen(ex) => ExprParen(folder.fold_expr(ex))

0 commit comments

Comments
 (0)