@@ -982,12 +982,12 @@ pub struct Arm {
982982/// Access of a named (e.g., `obj.foo`) or unnamed (e.g., `obj.0`) struct field.
983983#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
984984pub struct Field {
985+ pub attrs : ThinVec < Attribute > ,
986+ pub id : NodeId ,
987+ pub span : Span ,
985988 pub ident : Ident ,
986989 pub expr : P < Expr > ,
987- pub span : Span ,
988990 pub is_shorthand : bool ,
989- pub attrs : ThinVec < Attribute > ,
990- pub id : NodeId ,
991991 pub is_placeholder : bool ,
992992}
993993
@@ -1567,12 +1567,14 @@ pub struct FnSig {
15671567/// signature) or provided (meaning it has a default implementation).
15681568#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
15691569pub struct TraitItem {
1570+ pub attrs : Vec < Attribute > ,
15701571 pub id : NodeId ,
1572+ pub span : Span ,
1573+ pub vis : Visibility ,
15711574 pub ident : Ident ,
1572- pub attrs : Vec < Attribute > ,
1575+
15731576 pub generics : Generics ,
15741577 pub kind : TraitItemKind ,
1575- pub span : Span ,
15761578 /// See `Item::tokens` for what this is.
15771579 pub tokens : Option < TokenStream > ,
15781580}
@@ -1588,14 +1590,15 @@ pub enum TraitItemKind {
15881590/// Represents anything within an `impl` block.
15891591#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
15901592pub struct ImplItem {
1593+ pub attrs : Vec < Attribute > ,
15911594 pub id : NodeId ,
1592- pub ident : Ident ,
1595+ pub span : Span ,
15931596 pub vis : Visibility ,
1597+ pub ident : Ident ,
1598+
15941599 pub defaultness : Defaultness ,
1595- pub attrs : Vec < Attribute > ,
15961600 pub generics : Generics ,
15971601 pub kind : ImplItemKind ,
1598- pub span : Span ,
15991602 /// See `Item::tokens` for what this is.
16001603 pub tokens : Option < TokenStream > ,
16011604}
@@ -2174,22 +2177,24 @@ pub struct GlobalAsm {
21742177pub struct EnumDef {
21752178 pub variants : Vec < Variant > ,
21762179}
2177-
21782180/// Enum variant.
21792181#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
21802182pub struct Variant {
2181- /// Name of the variant.
2182- pub ident : Ident ,
21832183 /// Attributes of the variant.
21842184 pub attrs : Vec < Attribute > ,
21852185 /// Id of the variant (not the constructor, see `VariantData::ctor_id()`).
21862186 pub id : NodeId ,
2187+ /// Span
2188+ pub span : Span ,
2189+ /// The visibility of the variant. Syntactically accepted but not semantically.
2190+ pub vis : Visibility ,
2191+ /// Name of the variant.
2192+ pub ident : Ident ,
2193+
21872194 /// Fields and constructor id of the variant.
21882195 pub data : VariantData ,
21892196 /// Explicit discriminant, e.g., `Foo = 1`.
21902197 pub disr_expr : Option < AnonConst > ,
2191- /// Span
2192- pub span : Span ,
21932198 /// Is a macro placeholder
21942199 pub is_placeholder : bool ,
21952200}
@@ -2368,12 +2373,13 @@ impl VisibilityKind {
23682373/// E.g., `bar: usize` as in `struct Foo { bar: usize }`.
23692374#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
23702375pub struct StructField {
2376+ pub attrs : Vec < Attribute > ,
2377+ pub id : NodeId ,
23712378 pub span : Span ,
2372- pub ident : Option < Ident > ,
23732379 pub vis : Visibility ,
2374- pub id : NodeId ,
2380+ pub ident : Option < Ident > ,
2381+
23752382 pub ty : P < Ty > ,
2376- pub attrs : Vec < Attribute > ,
23772383 pub is_placeholder : bool ,
23782384}
23792385
@@ -2417,12 +2423,13 @@ impl VariantData {
24172423/// The name might be a dummy name in case of anonymous items.
24182424#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
24192425pub struct Item {
2420- pub ident : Ident ,
24212426 pub attrs : Vec < Attribute > ,
24222427 pub id : NodeId ,
2423- pub kind : ItemKind ,
2424- pub vis : Visibility ,
24252428 pub span : Span ,
2429+ pub vis : Visibility ,
2430+ pub ident : Ident ,
2431+
2432+ pub kind : ItemKind ,
24262433
24272434 /// Original tokens this item was parsed from. This isn't necessarily
24282435 /// available for all items, although over time more and more items should
@@ -2579,12 +2586,13 @@ impl ItemKind {
25792586
25802587#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
25812588pub struct ForeignItem {
2582- pub ident : Ident ,
25832589 pub attrs : Vec < Attribute > ,
2584- pub kind : ForeignItemKind ,
25852590 pub id : NodeId ,
25862591 pub span : Span ,
25872592 pub vis : Visibility ,
2593+ pub ident : Ident ,
2594+
2595+ pub kind : ForeignItemKind ,
25882596}
25892597
25902598/// An item within an `extern` block.
0 commit comments