@@ -230,8 +230,8 @@ impl<'hir> PathSegment<'hir> {
230230}
231231
232232#[ derive( Clone , Copy , Debug , HashStable_Generic ) ]
233- pub struct ConstArg {
234- pub value : AnonConst ,
233+ pub struct ConstArg < ' hir > {
234+ pub value : & ' hir AnonConst ,
235235 pub span : Span ,
236236 /// Indicates whether this comes from a `~const` desugaring.
237237 pub is_desugared_from_effects : bool ,
@@ -253,7 +253,7 @@ impl InferArg {
253253pub enum GenericArg < ' hir > {
254254 Lifetime ( & ' hir Lifetime ) ,
255255 Type ( & ' hir Ty < ' hir > ) ,
256- Const ( ConstArg ) ,
256+ Const ( ConstArg < ' hir > ) ,
257257 Infer ( InferArg ) ,
258258}
259259
@@ -491,7 +491,7 @@ pub enum GenericParamKind<'hir> {
491491 Const {
492492 ty : & ' hir Ty < ' hir > ,
493493 /// Optional default value for the const generic param
494- default : Option < AnonConst > ,
494+ default : Option < & ' hir AnonConst > ,
495495 is_host_effect : bool ,
496496 } ,
497497}
@@ -1563,12 +1563,12 @@ impl fmt::Display for ConstContext {
15631563pub type Lit = Spanned < LitKind > ;
15641564
15651565#[ derive( Copy , Clone , Debug , HashStable_Generic ) ]
1566- pub enum ArrayLen {
1566+ pub enum ArrayLen < ' hir > {
15671567 Infer ( InferArg ) ,
1568- Body ( AnonConst ) ,
1568+ Body ( & ' hir AnonConst ) ,
15691569}
15701570
1571- impl ArrayLen {
1571+ impl ArrayLen < ' _ > {
15721572 pub fn hir_id ( & self ) -> HirId {
15731573 match self {
15741574 ArrayLen :: Infer ( InferArg { hir_id, .. } ) | ArrayLen :: Body ( AnonConst { hir_id, .. } ) => {
@@ -1965,7 +1965,7 @@ pub enum ExprKind<'hir> {
19651965 ///
19661966 /// E.g., `[1; 5]`. The first expression is the element
19671967 /// to be repeated; the second is the number of times to repeat it.
1968- Repeat ( & ' hir Expr < ' hir > , ArrayLen ) ,
1968+ Repeat ( & ' hir Expr < ' hir > , ArrayLen < ' hir > ) ,
19691969
19701970 /// A suspension point for coroutines (i.e., `yield <expr>`).
19711971 Yield ( & ' hir Expr < ' hir > , YieldSource ) ,
@@ -2345,7 +2345,7 @@ pub struct TypeBinding<'hir> {
23452345#[ derive( Debug , Clone , Copy , HashStable_Generic ) ]
23462346pub enum Term < ' hir > {
23472347 Ty ( & ' hir Ty < ' hir > ) ,
2348- Const ( AnonConst ) ,
2348+ Const ( & ' hir AnonConst ) ,
23492349}
23502350
23512351impl < ' hir > From < & ' hir Ty < ' hir > > for Term < ' hir > {
@@ -2354,8 +2354,8 @@ impl<'hir> From<&'hir Ty<'hir>> for Term<'hir> {
23542354 }
23552355}
23562356
2357- impl < ' hir > From < AnonConst > for Term < ' hir > {
2358- fn from ( c : AnonConst ) -> Self {
2357+ impl < ' hir > From < & ' hir AnonConst > for Term < ' hir > {
2358+ fn from ( c : & ' hir AnonConst ) -> Self {
23592359 Term :: Const ( c)
23602360 }
23612361}
@@ -2646,7 +2646,7 @@ pub enum TyKind<'hir> {
26462646 /// A variable length slice (i.e., `[T]`).
26472647 Slice ( & ' hir Ty < ' hir > ) ,
26482648 /// A fixed length array (i.e., `[T; n]`).
2649- Array ( & ' hir Ty < ' hir > , ArrayLen ) ,
2649+ Array ( & ' hir Ty < ' hir > , ArrayLen < ' hir > ) ,
26502650 /// A raw pointer (i.e., `*const T` or `*mut T`).
26512651 Ptr ( MutTy < ' hir > ) ,
26522652 /// A reference (i.e., `&'a T` or `&'a mut T`).
@@ -2675,7 +2675,7 @@ pub enum TyKind<'hir> {
26752675 /// where `Bound` is a trait or a lifetime.
26762676 TraitObject ( & ' hir [ PolyTraitRef < ' hir > ] , & ' hir Lifetime , TraitObjectSyntax ) ,
26772677 /// Unused for now.
2678- Typeof ( AnonConst ) ,
2678+ Typeof ( & ' hir AnonConst ) ,
26792679 /// `TyKind::Infer` means the type should be inferred instead of it having been
26802680 /// specified. This can appear anywhere in a type.
26812681 Infer ,
@@ -2708,10 +2708,10 @@ pub enum InlineAsmOperand<'hir> {
27082708 out_expr : Option < & ' hir Expr < ' hir > > ,
27092709 } ,
27102710 Const {
2711- anon_const : AnonConst ,
2711+ anon_const : & ' hir AnonConst ,
27122712 } ,
27132713 SymFn {
2714- anon_const : AnonConst ,
2714+ anon_const : & ' hir AnonConst ,
27152715 } ,
27162716 SymStatic {
27172717 path : QPath < ' hir > ,
@@ -2913,7 +2913,7 @@ pub struct Variant<'hir> {
29132913 /// Fields and constructor id of the variant.
29142914 pub data : VariantData < ' hir > ,
29152915 /// Explicit discriminant (e.g., `Foo = 1`).
2916- pub disr_expr : Option < AnonConst > ,
2916+ pub disr_expr : Option < & ' hir AnonConst > ,
29172917 /// Span
29182918 pub span : Span ,
29192919}
@@ -3833,7 +3833,7 @@ mod size_asserts {
38333833 static_assert_size ! ( FnDecl <' _>, 40 ) ;
38343834 static_assert_size ! ( ForeignItem <' _>, 72 ) ;
38353835 static_assert_size ! ( ForeignItemKind <' _>, 40 ) ;
3836- static_assert_size ! ( GenericArg <' _>, 32 ) ;
3836+ static_assert_size ! ( GenericArg <' _>, 24 ) ;
38373837 static_assert_size ! ( GenericBound <' _>, 48 ) ;
38383838 static_assert_size ! ( Generics <' _>, 56 ) ;
38393839 static_assert_size ! ( Impl <' _>, 80 ) ;
0 commit comments