@@ -2263,21 +2263,21 @@ pub struct GlobalAsm {
2263
2263
}
2264
2264
2265
2265
#[ derive( RustcEncodable , RustcDecodable , Debug , HashStable ) ]
2266
- pub struct EnumDef {
2267
- pub variants : HirVec < Variant > ,
2266
+ pub struct EnumDef < ' hir > {
2267
+ pub variants : & ' hir [ Variant < ' hir > ] ,
2268
2268
}
2269
2269
2270
2270
#[ derive( RustcEncodable , RustcDecodable , Debug , HashStable ) ]
2271
- pub struct Variant {
2271
+ pub struct Variant < ' hir > {
2272
2272
/// Name of the variant.
2273
2273
#[ stable_hasher( project( name) ) ]
2274
2274
pub ident : Ident ,
2275
2275
/// Attributes of the variant.
2276
- pub attrs : HirVec < Attribute > ,
2276
+ pub attrs : & ' hir [ Attribute ] ,
2277
2277
/// Id of the variant (not the constructor, see `VariantData::ctor_hir_id()`).
2278
2278
pub id : HirId ,
2279
2279
/// Fields and constructor id of the variant.
2280
- pub data : VariantData ,
2280
+ pub data : VariantData < ' hir > ,
2281
2281
/// Explicit discriminant (e.g., `Foo = 1`).
2282
2282
pub disr_expr : Option < AnonConst > ,
2283
2283
/// Span
@@ -2397,24 +2397,24 @@ impl StructField {
2397
2397
2398
2398
/// Fields and constructor IDs of enum variants and structs.
2399
2399
#[ derive( RustcEncodable , RustcDecodable , Debug , HashStable ) ]
2400
- pub enum VariantData {
2400
+ pub enum VariantData < ' hir > {
2401
2401
/// A struct variant.
2402
2402
///
2403
2403
/// E.g., `Bar { .. }` as in `enum Foo { Bar { .. } }`.
2404
- Struct ( HirVec < StructField > , /* recovered */ bool ) ,
2404
+ Struct ( & ' hir [ StructField ] , /* recovered */ bool ) ,
2405
2405
/// A tuple variant.
2406
2406
///
2407
2407
/// E.g., `Bar(..)` as in `enum Foo { Bar(..) }`.
2408
- Tuple ( HirVec < StructField > , HirId ) ,
2408
+ Tuple ( & ' hir [ StructField ] , HirId ) ,
2409
2409
/// A unit variant.
2410
2410
///
2411
2411
/// E.g., `Bar = ..` as in `enum Foo { Bar = .. }`.
2412
2412
Unit ( HirId ) ,
2413
2413
}
2414
2414
2415
- impl VariantData {
2415
+ impl VariantData < ' hir > {
2416
2416
/// Return the fields of this variant.
2417
- pub fn fields ( & self ) -> & [ StructField ] {
2417
+ pub fn fields ( & self ) -> & ' hir [ StructField ] {
2418
2418
match * self {
2419
2419
VariantData :: Struct ( ref fields, ..) | VariantData :: Tuple ( ref fields, ..) => fields,
2420
2420
_ => & [ ] ,
@@ -2499,11 +2499,11 @@ pub enum ItemKind<'hir> {
2499
2499
/// An opaque `impl Trait` type alias, e.g., `type Foo = impl Bar;`.
2500
2500
OpaqueTy ( OpaqueTy ) ,
2501
2501
/// An enum definition, e.g., `enum Foo<A, B> {C<A>, D<B>}`.
2502
- Enum ( EnumDef , Generics ) ,
2502
+ Enum ( EnumDef < ' hir > , Generics ) ,
2503
2503
/// A struct definition, e.g., `struct Foo<A> {x: A}`.
2504
- Struct ( VariantData , Generics ) ,
2504
+ Struct ( VariantData < ' hir > , Generics ) ,
2505
2505
/// A union definition, e.g., `union Foo<A, B> {x: A, y: B}`.
2506
- Union ( VariantData , Generics ) ,
2506
+ Union ( VariantData < ' hir > , Generics ) ,
2507
2507
/// A trait definition.
2508
2508
Trait ( IsAuto , Unsafety , Generics , GenericBounds , & ' hir [ TraitItemRef ] ) ,
2509
2509
/// A trait alias.
@@ -2791,7 +2791,7 @@ pub enum Node<'hir> {
2791
2791
ForeignItem ( & ' hir ForeignItem < ' hir > ) ,
2792
2792
TraitItem ( & ' hir TraitItem < ' hir > ) ,
2793
2793
ImplItem ( & ' hir ImplItem < ' hir > ) ,
2794
- Variant ( & ' hir Variant ) ,
2794
+ Variant ( & ' hir Variant < ' hir > ) ,
2795
2795
Field ( & ' hir StructField ) ,
2796
2796
AnonConst ( & ' hir AnonConst ) ,
2797
2797
Expr ( & ' hir Expr ) ,
@@ -2808,7 +2808,7 @@ pub enum Node<'hir> {
2808
2808
2809
2809
/// `Ctor` refers to the constructor of an enum variant or struct. Only tuple or unit variants
2810
2810
/// with synthesized constructors.
2811
- Ctor ( & ' hir VariantData ) ,
2811
+ Ctor ( & ' hir VariantData < ' hir > ) ,
2812
2812
2813
2813
Lifetime ( & ' hir Lifetime ) ,
2814
2814
GenericParam ( & ' hir GenericParam ) ,
0 commit comments