diff options
| author | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2013-01-13 13:45:57 -0800 |
|---|---|---|
| committer | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2013-01-14 18:15:54 -0800 |
| commit | 1f5e9ff362042fe815fddfdaf211f782aa944229 (patch) | |
| tree | e6797d32f60d32d862ad171c5beade22974f6a1f /src/libsyntax | |
| parent | 530a113bfa2702b415e38f3168d5c95ee1d93718 (diff) | |
| download | rust-1f5e9ff362042fe815fddfdaf211f782aa944229.tar.gz rust-1f5e9ff362042fe815fddfdaf211f782aa944229.zip | |
convert ast::struct_def to a struct
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/auto_encode.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/fold.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index cbcb790a6a8..c185fd36482 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1501,7 +1501,7 @@ impl struct_field_kind : cmp::Eq { #[auto_encode] #[auto_decode] -type struct_def = { +struct struct_def { fields: ~[@struct_field], /* fields */ /* (not including ctor or dtor) */ /* dtor is optional */ @@ -1509,7 +1509,7 @@ type struct_def = { /* ID of the constructor. This is only used for tuple- or enum-like * structs. */ ctor_id: Option<node_id> -}; +} /* FIXME (#3300): Should allow items to be anonymous. Right now diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs index 35b5f4be9a4..2e9876e2861 100644 --- a/src/libsyntax/ext/auto_encode.rs +++ b/src/libsyntax/ext/auto_encode.rs @@ -141,7 +141,7 @@ fn expand_auto_encode( ~[filter_attrs(*item), ser_impl] }, - ast::item_struct(@{ fields, _}, tps) => { + ast::item_struct(@ast::struct_def { fields, _}, tps) => { let ser_impl = mk_struct_ser_impl( cx, item.span, @@ -207,7 +207,7 @@ fn expand_auto_decode( ~[filter_attrs(*item), deser_impl] }, - ast::item_struct(@{ fields, _}, tps) => { + ast::item_struct(@ast::struct_def { fields, _}, tps) => { let deser_impl = mk_struct_deser_impl( cx, item.span, diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 8dfefbe55f3..c6a8bf7bd08 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -281,7 +281,7 @@ fn fold_struct_def(struct_def: @ast::struct_def, fld: ast_fold) .. dtor.node}, span: dtor.span } }; - return @{ + return @ast::struct_def { fields: vec::map(struct_def.fields, |f| fold_struct_field(*f, fld)), dtor: dtor, ctor_id: option::map(&struct_def.ctor_id, |cid| fld.new_id(*cid)) @@ -582,7 +582,7 @@ fn noop_fold_variant(v: variant_, fld: ast_fold) -> variant_ { .. dtor.node}, .. *dtor } }; - kind = struct_variant_kind(@{ + kind = struct_variant_kind(@ast::struct_def { fields: vec::map(struct_def.fields, |f| fld.fold_struct_field(*f)), dtor: dtor, diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index b0aa96f2222..db2d951eafe 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2844,7 +2844,7 @@ impl Parser { let _ = self.get_id(); // XXX: Workaround for crazy bug. let new_id = self.get_id(); (class_name, - item_struct(@{ + item_struct(@ast::struct_def { fields: fields, dtor: actual_dtor, ctor_id: if is_tuple_like { Some(new_id) } else { None } @@ -3340,7 +3340,7 @@ impl Parser { span: d_s } }; - return @{ + return @ast::struct_def { fields: fields, dtor: actual_dtor, ctor_id: None |
