diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index c185fd364828..2d6c848be893 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1457,11 +1457,11 @@ impl visibility : cmp::Eq { #[auto_encode] #[auto_decode] -type struct_field_ = { +struct struct_field_ { kind: struct_field_kind, id: node_id, - ty: @Ty -}; + ty: @Ty, +} type struct_field = spanned; diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index c6a8bf7bd085..23c3694ebb2e 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -216,9 +216,9 @@ fn noop_fold_item(&&i: @item, fld: ast_fold) -> Option<@item> { fn noop_fold_struct_field(&&sf: @struct_field, fld: ast_fold) -> @struct_field { - @spanned { node: { kind: copy sf.node.kind, - id: sf.node.id, - ty: fld.fold_ty(sf.node.ty) }, + @spanned { node: ast::struct_field_ { kind: copy sf.node.kind, + id: sf.node.id, + ty: fld.fold_ty(sf.node.ty) }, span: sf.span } } @@ -293,9 +293,9 @@ fn fold_trait_ref(&&p: @trait_ref, fld: ast_fold) -> @trait_ref { } fn fold_struct_field(&&f: @struct_field, fld: ast_fold) -> @struct_field { - @spanned { node: { kind: copy f.node.kind, - id: fld.new_id(f.node.id), - ty: fld.fold_ty(f.node.ty) }, + @spanned { node: ast::struct_field_ { kind: copy f.node.kind, + id: fld.new_id(f.node.id), + ty: fld.fold_ty(f.node.ty) }, span: fld.new_span(f.span) } } @@ -693,10 +693,14 @@ impl ast_fold_fns: ast_fold { return (self.fold_item)(i, self as ast_fold); } fn fold_struct_field(&&sf: @struct_field) -> @struct_field { - @spanned { node: { kind: copy sf.node.kind, - id: sf.node.id, - ty: (self as ast_fold).fold_ty(sf.node.ty) }, - span: (self.new_span)(sf.span) } + @spanned { + node: ast::struct_field_ { + kind: copy sf.node.kind, + id: sf.node.id, + ty: (self as ast_fold).fold_ty(sf.node.ty), + }, + span: (self.new_span)(sf.span), + } } fn fold_item_underscore(i: item_) -> item_ { diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index db2d951eafe4..f7651d31766f 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2150,11 +2150,11 @@ impl Parser { let name = self.parse_ident(); self.expect(token::COLON); let ty = self.parse_ty(false); - return @spanned(lo, self.last_span.hi, { + @spanned(lo, self.last_span.hi, ast::struct_field_ { kind: named_field(name, is_mutbl, pr), id: self.get_id(), ty: ty - }); + }) } fn parse_stmt(+first_item_attrs: ~[attribute]) -> @stmt { @@ -2816,7 +2816,7 @@ impl Parser { seq_sep_trailing_allowed (token::COMMA)) |p| { let lo = p.span.lo; - let struct_field_ = { + let struct_field_ = ast::struct_field_ { kind: unnamed_field, id: self.get_id(), ty: p.parse_ty(false) @@ -2893,7 +2893,9 @@ impl Parser { self.parse_method(); // bogus value @spanned(self.span.lo, self.span.hi, - { kind: unnamed_field, id: self.get_id(), + ast::struct_field_ { + kind: unnamed_field, + id: self.get_id(), ty: @{id: self.get_id(), node: ty_nil, span: copy self.span} })