@@ -241,17 +241,17 @@ impl<'hir> PathSegment<'hir> {
241241 }
242242}
243243
244- #[ derive( Encodable , Debug , HashStable_Generic ) ]
245- pub struct ConstArg {
246- pub value : AnonConst ,
244+ #[ derive( Debug , HashStable_Generic ) ]
245+ pub struct ConstArg < ' hir > {
246+ pub value : AnonConst < ' hir > ,
247247 pub span : Span ,
248248}
249249
250250#[ derive( Debug , HashStable_Generic ) ]
251251pub enum GenericArg < ' hir > {
252252 Lifetime ( Lifetime ) ,
253253 Type ( Ty < ' hir > ) ,
254- Const ( ConstArg ) ,
254+ Const ( ConstArg < ' hir > ) ,
255255}
256256
257257impl GenericArg < ' _ > {
@@ -1354,9 +1354,11 @@ pub type Lit = Spanned<LitKind>;
13541354/// These are usually found nested inside types (e.g., array lengths)
13551355/// or expressions (e.g., repeat counts), and also used to define
13561356/// explicit discriminant values for enum variants.
1357- #[ derive( Copy , Clone , PartialEq , Eq , Encodable , Debug , HashStable_Generic ) ]
1358- pub struct AnonConst {
1357+ #[ derive( Debug , HashStable_Generic ) ]
1358+ pub struct AnonConst < ' hir > {
13591359 pub hir_id : HirId ,
1360+ pub generics : Generics < ' hir > ,
1361+ pub generic_args : GenericArgs < ' hir > ,
13601362 pub body : BodyId ,
13611363}
13621364
@@ -1371,7 +1373,7 @@ pub struct Expr<'hir> {
13711373
13721374// `Expr` is used a lot. Make sure it doesn't unintentionally get bigger.
13731375#[ cfg( target_arch = "x86_64" ) ]
1374- rustc_data_structures:: static_assert_size!( Expr <' static >, 72 ) ;
1376+ rustc_data_structures:: static_assert_size!( Expr <' static >, 144 ) ;
13751377
13761378impl Expr < ' _ > {
13771379 pub fn precedence ( & self ) -> ExprPrecedence {
@@ -1519,7 +1521,7 @@ pub enum ExprKind<'hir> {
15191521 /// A `box x` expression.
15201522 Box ( & ' hir Expr < ' hir > ) ,
15211523 /// Allow anonymous constants from an inline `const` block
1522- ConstBlock ( AnonConst ) ,
1524+ ConstBlock ( AnonConst < ' hir > ) ,
15231525 /// An array (e.g., `[a, b, c, d]`).
15241526 Array ( & ' hir [ Expr < ' hir > ] ) ,
15251527 /// A function call.
@@ -1619,7 +1621,7 @@ pub enum ExprKind<'hir> {
16191621 ///
16201622 /// E.g., `[1; 5]`. The first expression is the element
16211623 /// to be repeated; the second is the number of times to repeat it.
1622- Repeat ( & ' hir Expr < ' hir > , AnonConst ) ,
1624+ Repeat ( & ' hir Expr < ' hir > , AnonConst < ' hir > ) ,
16231625
16241626 /// A suspension point for generators (i.e., `yield <expr>`).
16251627 Yield ( & ' hir Expr < ' hir > , YieldSource ) ,
@@ -2064,7 +2066,7 @@ pub enum TyKind<'hir> {
20642066 /// A variable length slice (i.e., `[T]`).
20652067 Slice ( & ' hir Ty < ' hir > ) ,
20662068 /// A fixed length array (i.e., `[T; n]`).
2067- Array ( & ' hir Ty < ' hir > , AnonConst ) ,
2069+ Array ( & ' hir Ty < ' hir > , AnonConst < ' hir > ) ,
20682070 /// A raw pointer (i.e., `*const T` or `*mut T`).
20692071 Ptr ( MutTy < ' hir > ) ,
20702072 /// A reference (i.e., `&'a T` or `&'a mut T`).
@@ -2090,7 +2092,7 @@ pub enum TyKind<'hir> {
20902092 /// where `Bound` is a trait or a lifetime.
20912093 TraitObject ( & ' hir [ PolyTraitRef < ' hir > ] , Lifetime ) ,
20922094 /// Unused for now.
2093- Typeof ( AnonConst ) ,
2095+ Typeof ( AnonConst < ' hir > ) ,
20942096 /// `TyKind::Infer` means the type should be inferred instead of it having been
20952097 /// specified. This can appear anywhere in a type.
20962098 Infer ,
@@ -2306,7 +2308,7 @@ pub struct Variant<'hir> {
23062308 /// Fields and constructor id of the variant.
23072309 pub data : VariantData < ' hir > ,
23082310 /// Explicit discriminant (e.g., `Foo = 1`).
2309- pub disr_expr : Option < AnonConst > ,
2311+ pub disr_expr : Option < AnonConst < ' hir > > ,
23102312 /// Span
23112313 pub span : Span ,
23122314}
@@ -2693,7 +2695,7 @@ pub enum Node<'hir> {
26932695 ImplItem ( & ' hir ImplItem < ' hir > ) ,
26942696 Variant ( & ' hir Variant < ' hir > ) ,
26952697 Field ( & ' hir StructField < ' hir > ) ,
2696- AnonConst ( & ' hir AnonConst ) ,
2698+ AnonConst ( & ' hir AnonConst < ' hir > ) ,
26972699 Expr ( & ' hir Expr < ' hir > ) ,
26982700 Stmt ( & ' hir Stmt < ' hir > ) ,
26992701 PathSegment ( & ' hir PathSegment < ' hir > ) ,
0 commit comments