@@ -961,12 +961,12 @@ pub struct Arm {
961961/// Access of a named (e.g., `obj.foo`) or unnamed (e.g., `obj.0`) struct field.
962962#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
963963pub struct Field {
964+ pub attrs : ThinVec < Attribute > ,
965+ pub id : NodeId ,
966+ pub span : Span ,
964967 pub ident : Ident ,
965968 pub expr : P < Expr > ,
966- pub span : Span ,
967969 pub is_shorthand : bool ,
968- pub attrs : ThinVec < Attribute > ,
969- pub id : NodeId ,
970970 pub is_placeholder : bool ,
971971}
972972
@@ -1515,12 +1515,14 @@ pub struct FnSig {
15151515/// signature) or provided (meaning it has a default implementation).
15161516#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
15171517pub struct TraitItem {
1518+ pub attrs : Vec < Attribute > ,
15181519 pub id : NodeId ,
1520+ pub span : Span ,
1521+ pub vis : Visibility ,
15191522 pub ident : Ident ,
1520- pub attrs : Vec < Attribute > ,
1523+
15211524 pub generics : Generics ,
15221525 pub kind : TraitItemKind ,
1523- pub span : Span ,
15241526 /// See `Item::tokens` for what this is.
15251527 pub tokens : Option < TokenStream > ,
15261528}
@@ -1536,14 +1538,15 @@ pub enum TraitItemKind {
15361538/// Represents anything within an `impl` block.
15371539#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
15381540pub struct ImplItem {
1541+ pub attrs : Vec < Attribute > ,
15391542 pub id : NodeId ,
1540- pub ident : Ident ,
1543+ pub span : Span ,
15411544 pub vis : Visibility ,
1545+ pub ident : Ident ,
1546+
15421547 pub defaultness : Defaultness ,
1543- pub attrs : Vec < Attribute > ,
15441548 pub generics : Generics ,
15451549 pub kind : ImplItemKind ,
1546- pub span : Span ,
15471550 /// See `Item::tokens` for what this is.
15481551 pub tokens : Option < TokenStream > ,
15491552}
@@ -2101,22 +2104,24 @@ pub struct GlobalAsm {
21012104pub struct EnumDef {
21022105 pub variants : Vec < Variant > ,
21032106}
2104-
21052107/// Enum variant.
21062108#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
21072109pub struct Variant {
2108- /// Name of the variant.
2109- pub ident : Ident ,
21102110 /// Attributes of the variant.
21112111 pub attrs : Vec < Attribute > ,
21122112 /// Id of the variant (not the constructor, see `VariantData::ctor_id()`).
21132113 pub id : NodeId ,
2114+ /// Span
2115+ pub span : Span ,
2116+ /// The visibility of the variant. Syntactically accepted but not semantically.
2117+ pub vis : Visibility ,
2118+ /// Name of the variant.
2119+ pub ident : Ident ,
2120+
21142121 /// Fields and constructor id of the variant.
21152122 pub data : VariantData ,
21162123 /// Explicit discriminant, e.g., `Foo = 1`.
21172124 pub disr_expr : Option < AnonConst > ,
2118- /// Span
2119- pub span : Span ,
21202125 /// Is a macro placeholder
21212126 pub is_placeholder : bool ,
21222127}
@@ -2295,12 +2300,13 @@ impl VisibilityKind {
22952300/// E.g., `bar: usize` as in `struct Foo { bar: usize }`.
22962301#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
22972302pub struct StructField {
2303+ pub attrs : Vec < Attribute > ,
2304+ pub id : NodeId ,
22982305 pub span : Span ,
2299- pub ident : Option < Ident > ,
23002306 pub vis : Visibility ,
2301- pub id : NodeId ,
2307+ pub ident : Option < Ident > ,
2308+
23022309 pub ty : P < Ty > ,
2303- pub attrs : Vec < Attribute > ,
23042310 pub is_placeholder : bool ,
23052311}
23062312
@@ -2344,12 +2350,13 @@ impl VariantData {
23442350/// The name might be a dummy name in case of anonymous items.
23452351#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
23462352pub struct Item {
2347- pub ident : Ident ,
23482353 pub attrs : Vec < Attribute > ,
23492354 pub id : NodeId ,
2350- pub kind : ItemKind ,
2351- pub vis : Visibility ,
23522355 pub span : Span ,
2356+ pub vis : Visibility ,
2357+ pub ident : Ident ,
2358+
2359+ pub kind : ItemKind ,
23532360
23542361 /// Original tokens this item was parsed from. This isn't necessarily
23552362 /// available for all items, although over time more and more items should
@@ -2518,12 +2525,13 @@ impl ItemKind {
25182525
25192526#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
25202527pub struct ForeignItem {
2521- pub ident : Ident ,
25222528 pub attrs : Vec < Attribute > ,
2523- pub kind : ForeignItemKind ,
25242529 pub id : NodeId ,
25252530 pub span : Span ,
25262531 pub vis : Visibility ,
2532+ pub ident : Ident ,
2533+
2534+ pub kind : ForeignItemKind ,
25272535}
25282536
25292537/// An item within an `extern` block.
0 commit comments