diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index b2fdec855190f974f9b36bbbb5f663385b595258..8e24bd0f38e93bc0bac06e184320025de43af066 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -3798,7 +3798,9 @@ fn ty_dtor(cx: ctxt, struct_id: def_id) -> DtorKind { if is_local(struct_id) { match cx.items.find(struct_id.node) { Some(ast_map::node_item(@ast::item { - node: ast::item_struct(@{ dtor: Some(ref dtor), _ }, _), + node: ast::item_struct(@ast::struct_def { dtor: Some(ref dtor), + _ }, + _), _ }, _)) => LegacyDtor(local_def((*dtor).node.id)), diff --git a/src/librustdoc/tystr_pass.rs b/src/librustdoc/tystr_pass.rs index 5309c38e3cdf00468b1b2a8611248dabcdbf93e8..5d92ed14c18df6ddf7a55f4e30f38f04a3d35b2b 100644 --- a/src/librustdoc/tystr_pass.rs +++ b/src/librustdoc/tystr_pass.rs @@ -371,7 +371,7 @@ fn fold_struct( fn strip_struct_extra_stuff(item: @ast::item) -> @ast::item { let node = match item.node { ast::item_struct(def, tys) => { - let def = @{ + let def = @ast::struct_def { dtor: None, // Remove the drop { } block .. *def }; diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index cbcb790a6a88778fedf39cd9a48001a4787b1461..c185fd364828d3da70305ac5f67c7d37aea4389d 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 @@ impl struct_field_kind : cmp::Eq { /* ID of the constructor. This is only used for tuple- or enum-like * structs. */ ctor_id: Option -}; +} /* 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 35b5f4be9a441be15ab6b1e04bd2c0f94810ea80..2e9876e286171aeeae9ed8233800c5e16ff662a3 100644 --- a/src/libsyntax/ext/auto_encode.rs +++ b/src/libsyntax/ext/auto_encode.rs @@ -141,7 +141,7 @@ fn filter_attrs(item: @ast::item) -> @ast::item { ~[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 filter_attrs(item: @ast::item) -> @ast::item { ~[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 8dfefbe55f3f5c9e541f6d6f166f6ff293bdaf24..c6a8bf7bd085cd8308b5e7c9402265ce4463609f 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 fold_variant_arg_(va: variant_arg, fld: ast_fold) -> variant_arg { .. 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 b0aa96f2222d22cce5856e771879c20a516fbbd4..db2d951eafe4ed844211d39fb10b580cdc2e9b2f 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2844,7 +2844,7 @@ fn parse_item_struct() -> item_info { 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 @@ fn parse_struct_def() -> @struct_def { span: d_s } }; - return @{ + return @ast::struct_def { fields: fields, dtor: actual_dtor, ctor_id: None