@@ -961,12 +961,12 @@ pub struct Arm {
961
961
/// Access of a named (e.g., `obj.foo`) or unnamed (e.g., `obj.0`) struct field.
962
962
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
963
963
pub struct Field {
964
+ pub attrs : ThinVec < Attribute > ,
965
+ pub id : NodeId ,
966
+ pub span : Span ,
964
967
pub ident : Ident ,
965
968
pub expr : P < Expr > ,
966
- pub span : Span ,
967
969
pub is_shorthand : bool ,
968
- pub attrs : ThinVec < Attribute > ,
969
- pub id : NodeId ,
970
970
pub is_placeholder : bool ,
971
971
}
972
972
@@ -1515,12 +1515,14 @@ pub struct FnSig {
1515
1515
/// signature) or provided (meaning it has a default implementation).
1516
1516
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
1517
1517
pub struct TraitItem {
1518
+ pub attrs : Vec < Attribute > ,
1518
1519
pub id : NodeId ,
1520
+ pub span : Span ,
1521
+ pub vis : Visibility ,
1519
1522
pub ident : Ident ,
1520
- pub attrs : Vec < Attribute > ,
1523
+
1521
1524
pub generics : Generics ,
1522
1525
pub kind : TraitItemKind ,
1523
- pub span : Span ,
1524
1526
/// See `Item::tokens` for what this is.
1525
1527
pub tokens : Option < TokenStream > ,
1526
1528
}
@@ -1536,14 +1538,15 @@ pub enum TraitItemKind {
1536
1538
/// Represents anything within an `impl` block.
1537
1539
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
1538
1540
pub struct ImplItem {
1541
+ pub attrs : Vec < Attribute > ,
1539
1542
pub id : NodeId ,
1540
- pub ident : Ident ,
1543
+ pub span : Span ,
1541
1544
pub vis : Visibility ,
1545
+ pub ident : Ident ,
1546
+
1542
1547
pub defaultness : Defaultness ,
1543
- pub attrs : Vec < Attribute > ,
1544
1548
pub generics : Generics ,
1545
1549
pub kind : ImplItemKind ,
1546
- pub span : Span ,
1547
1550
/// See `Item::tokens` for what this is.
1548
1551
pub tokens : Option < TokenStream > ,
1549
1552
}
@@ -2101,22 +2104,24 @@ pub struct GlobalAsm {
2101
2104
pub struct EnumDef {
2102
2105
pub variants : Vec < Variant > ,
2103
2106
}
2104
-
2105
2107
/// Enum variant.
2106
2108
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
2107
2109
pub struct Variant {
2108
- /// Name of the variant.
2109
- pub ident : Ident ,
2110
2110
/// Attributes of the variant.
2111
2111
pub attrs : Vec < Attribute > ,
2112
2112
/// Id of the variant (not the constructor, see `VariantData::ctor_id()`).
2113
2113
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
+
2114
2121
/// Fields and constructor id of the variant.
2115
2122
pub data : VariantData ,
2116
2123
/// Explicit discriminant, e.g., `Foo = 1`.
2117
2124
pub disr_expr : Option < AnonConst > ,
2118
- /// Span
2119
- pub span : Span ,
2120
2125
/// Is a macro placeholder
2121
2126
pub is_placeholder : bool ,
2122
2127
}
@@ -2295,12 +2300,13 @@ impl VisibilityKind {
2295
2300
/// E.g., `bar: usize` as in `struct Foo { bar: usize }`.
2296
2301
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
2297
2302
pub struct StructField {
2303
+ pub attrs : Vec < Attribute > ,
2304
+ pub id : NodeId ,
2298
2305
pub span : Span ,
2299
- pub ident : Option < Ident > ,
2300
2306
pub vis : Visibility ,
2301
- pub id : NodeId ,
2307
+ pub ident : Option < Ident > ,
2308
+
2302
2309
pub ty : P < Ty > ,
2303
- pub attrs : Vec < Attribute > ,
2304
2310
pub is_placeholder : bool ,
2305
2311
}
2306
2312
@@ -2344,12 +2350,13 @@ impl VariantData {
2344
2350
/// The name might be a dummy name in case of anonymous items.
2345
2351
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
2346
2352
pub struct Item {
2347
- pub ident : Ident ,
2348
2353
pub attrs : Vec < Attribute > ,
2349
2354
pub id : NodeId ,
2350
- pub kind : ItemKind ,
2351
- pub vis : Visibility ,
2352
2355
pub span : Span ,
2356
+ pub vis : Visibility ,
2357
+ pub ident : Ident ,
2358
+
2359
+ pub kind : ItemKind ,
2353
2360
2354
2361
/// Original tokens this item was parsed from. This isn't necessarily
2355
2362
/// available for all items, although over time more and more items should
@@ -2518,12 +2525,13 @@ impl ItemKind {
2518
2525
2519
2526
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
2520
2527
pub struct ForeignItem {
2521
- pub ident : Ident ,
2522
2528
pub attrs : Vec < Attribute > ,
2523
- pub kind : ForeignItemKind ,
2524
2529
pub id : NodeId ,
2525
2530
pub span : Span ,
2526
2531
pub vis : Visibility ,
2532
+ pub ident : Ident ,
2533
+
2534
+ pub kind : ForeignItemKind ,
2527
2535
}
2528
2536
2529
2537
/// An item within an `extern` block.
0 commit comments