@@ -982,12 +982,12 @@ pub struct Arm {
982
982
/// Access of a named (e.g., `obj.foo`) or unnamed (e.g., `obj.0`) struct field.
983
983
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
984
984
pub struct Field {
985
+ pub attrs : ThinVec < Attribute > ,
986
+ pub id : NodeId ,
987
+ pub span : Span ,
985
988
pub ident : Ident ,
986
989
pub expr : P < Expr > ,
987
- pub span : Span ,
988
990
pub is_shorthand : bool ,
989
- pub attrs : ThinVec < Attribute > ,
990
- pub id : NodeId ,
991
991
pub is_placeholder : bool ,
992
992
}
993
993
@@ -1567,12 +1567,14 @@ pub struct FnSig {
1567
1567
/// signature) or provided (meaning it has a default implementation).
1568
1568
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
1569
1569
pub struct TraitItem {
1570
+ pub attrs : Vec < Attribute > ,
1570
1571
pub id : NodeId ,
1572
+ pub span : Span ,
1573
+ pub vis : Visibility ,
1571
1574
pub ident : Ident ,
1572
- pub attrs : Vec < Attribute > ,
1575
+
1573
1576
pub generics : Generics ,
1574
1577
pub kind : TraitItemKind ,
1575
- pub span : Span ,
1576
1578
/// See `Item::tokens` for what this is.
1577
1579
pub tokens : Option < TokenStream > ,
1578
1580
}
@@ -1588,14 +1590,15 @@ pub enum TraitItemKind {
1588
1590
/// Represents anything within an `impl` block.
1589
1591
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
1590
1592
pub struct ImplItem {
1593
+ pub attrs : Vec < Attribute > ,
1591
1594
pub id : NodeId ,
1592
- pub ident : Ident ,
1595
+ pub span : Span ,
1593
1596
pub vis : Visibility ,
1597
+ pub ident : Ident ,
1598
+
1594
1599
pub defaultness : Defaultness ,
1595
- pub attrs : Vec < Attribute > ,
1596
1600
pub generics : Generics ,
1597
1601
pub kind : ImplItemKind ,
1598
- pub span : Span ,
1599
1602
/// See `Item::tokens` for what this is.
1600
1603
pub tokens : Option < TokenStream > ,
1601
1604
}
@@ -2174,22 +2177,24 @@ pub struct GlobalAsm {
2174
2177
pub struct EnumDef {
2175
2178
pub variants : Vec < Variant > ,
2176
2179
}
2177
-
2178
2180
/// Enum variant.
2179
2181
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
2180
2182
pub struct Variant {
2181
- /// Name of the variant.
2182
- pub ident : Ident ,
2183
2183
/// Attributes of the variant.
2184
2184
pub attrs : Vec < Attribute > ,
2185
2185
/// Id of the variant (not the constructor, see `VariantData::ctor_id()`).
2186
2186
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
+
2187
2194
/// Fields and constructor id of the variant.
2188
2195
pub data : VariantData ,
2189
2196
/// Explicit discriminant, e.g., `Foo = 1`.
2190
2197
pub disr_expr : Option < AnonConst > ,
2191
- /// Span
2192
- pub span : Span ,
2193
2198
/// Is a macro placeholder
2194
2199
pub is_placeholder : bool ,
2195
2200
}
@@ -2368,12 +2373,13 @@ impl VisibilityKind {
2368
2373
/// E.g., `bar: usize` as in `struct Foo { bar: usize }`.
2369
2374
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
2370
2375
pub struct StructField {
2376
+ pub attrs : Vec < Attribute > ,
2377
+ pub id : NodeId ,
2371
2378
pub span : Span ,
2372
- pub ident : Option < Ident > ,
2373
2379
pub vis : Visibility ,
2374
- pub id : NodeId ,
2380
+ pub ident : Option < Ident > ,
2381
+
2375
2382
pub ty : P < Ty > ,
2376
- pub attrs : Vec < Attribute > ,
2377
2383
pub is_placeholder : bool ,
2378
2384
}
2379
2385
@@ -2417,12 +2423,13 @@ impl VariantData {
2417
2423
/// The name might be a dummy name in case of anonymous items.
2418
2424
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
2419
2425
pub struct Item {
2420
- pub ident : Ident ,
2421
2426
pub attrs : Vec < Attribute > ,
2422
2427
pub id : NodeId ,
2423
- pub kind : ItemKind ,
2424
- pub vis : Visibility ,
2425
2428
pub span : Span ,
2429
+ pub vis : Visibility ,
2430
+ pub ident : Ident ,
2431
+
2432
+ pub kind : ItemKind ,
2426
2433
2427
2434
/// Original tokens this item was parsed from. This isn't necessarily
2428
2435
/// available for all items, although over time more and more items should
@@ -2579,12 +2586,13 @@ impl ItemKind {
2579
2586
2580
2587
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
2581
2588
pub struct ForeignItem {
2582
- pub ident : Ident ,
2583
2589
pub attrs : Vec < Attribute > ,
2584
- pub kind : ForeignItemKind ,
2585
2590
pub id : NodeId ,
2586
2591
pub span : Span ,
2587
2592
pub vis : Visibility ,
2593
+ pub ident : Ident ,
2594
+
2595
+ pub kind : ForeignItemKind ,
2588
2596
}
2589
2597
2590
2598
/// An item within an `extern` block.
0 commit comments