@@ -230,8 +230,8 @@ impl<'hir> PathSegment<'hir> {
230
230
}
231
231
232
232
#[ derive( Clone , Copy , Debug , HashStable_Generic ) ]
233
- pub struct ConstArg {
234
- pub value : AnonConst ,
233
+ pub struct ConstArg < ' hir > {
234
+ pub value : & ' hir AnonConst ,
235
235
pub span : Span ,
236
236
/// Indicates whether this comes from a `~const` desugaring.
237
237
pub is_desugared_from_effects : bool ,
@@ -253,7 +253,7 @@ impl InferArg {
253
253
pub enum GenericArg < ' hir > {
254
254
Lifetime ( & ' hir Lifetime ) ,
255
255
Type ( & ' hir Ty < ' hir > ) ,
256
- Const ( ConstArg ) ,
256
+ Const ( ConstArg < ' hir > ) ,
257
257
Infer ( InferArg ) ,
258
258
}
259
259
@@ -491,7 +491,7 @@ pub enum GenericParamKind<'hir> {
491
491
Const {
492
492
ty : & ' hir Ty < ' hir > ,
493
493
/// Optional default value for the const generic param
494
- default : Option < AnonConst > ,
494
+ default : Option < & ' hir AnonConst > ,
495
495
is_host_effect : bool ,
496
496
} ,
497
497
}
@@ -1563,12 +1563,12 @@ impl fmt::Display for ConstContext {
1563
1563
pub type Lit = Spanned < LitKind > ;
1564
1564
1565
1565
#[ derive( Copy , Clone , Debug , HashStable_Generic ) ]
1566
- pub enum ArrayLen {
1566
+ pub enum ArrayLen < ' hir > {
1567
1567
Infer ( InferArg ) ,
1568
- Body ( AnonConst ) ,
1568
+ Body ( & ' hir AnonConst ) ,
1569
1569
}
1570
1570
1571
- impl ArrayLen {
1571
+ impl ArrayLen < ' _ > {
1572
1572
pub fn hir_id ( & self ) -> HirId {
1573
1573
match self {
1574
1574
ArrayLen :: Infer ( InferArg { hir_id, .. } ) | ArrayLen :: Body ( AnonConst { hir_id, .. } ) => {
@@ -1965,7 +1965,7 @@ pub enum ExprKind<'hir> {
1965
1965
///
1966
1966
/// E.g., `[1; 5]`. The first expression is the element
1967
1967
/// 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 > ) ,
1969
1969
1970
1970
/// A suspension point for coroutines (i.e., `yield <expr>`).
1971
1971
Yield ( & ' hir Expr < ' hir > , YieldSource ) ,
@@ -2345,7 +2345,7 @@ pub struct TypeBinding<'hir> {
2345
2345
#[ derive( Debug , Clone , Copy , HashStable_Generic ) ]
2346
2346
pub enum Term < ' hir > {
2347
2347
Ty ( & ' hir Ty < ' hir > ) ,
2348
- Const ( AnonConst ) ,
2348
+ Const ( & ' hir AnonConst ) ,
2349
2349
}
2350
2350
2351
2351
impl < ' hir > From < & ' hir Ty < ' hir > > for Term < ' hir > {
@@ -2354,8 +2354,8 @@ impl<'hir> From<&'hir Ty<'hir>> for Term<'hir> {
2354
2354
}
2355
2355
}
2356
2356
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 {
2359
2359
Term :: Const ( c)
2360
2360
}
2361
2361
}
@@ -2646,7 +2646,7 @@ pub enum TyKind<'hir> {
2646
2646
/// A variable length slice (i.e., `[T]`).
2647
2647
Slice ( & ' hir Ty < ' hir > ) ,
2648
2648
/// A fixed length array (i.e., `[T; n]`).
2649
- Array ( & ' hir Ty < ' hir > , ArrayLen ) ,
2649
+ Array ( & ' hir Ty < ' hir > , ArrayLen < ' hir > ) ,
2650
2650
/// A raw pointer (i.e., `*const T` or `*mut T`).
2651
2651
Ptr ( MutTy < ' hir > ) ,
2652
2652
/// A reference (i.e., `&'a T` or `&'a mut T`).
@@ -2675,7 +2675,7 @@ pub enum TyKind<'hir> {
2675
2675
/// where `Bound` is a trait or a lifetime.
2676
2676
TraitObject ( & ' hir [ PolyTraitRef < ' hir > ] , & ' hir Lifetime , TraitObjectSyntax ) ,
2677
2677
/// Unused for now.
2678
- Typeof ( AnonConst ) ,
2678
+ Typeof ( & ' hir AnonConst ) ,
2679
2679
/// `TyKind::Infer` means the type should be inferred instead of it having been
2680
2680
/// specified. This can appear anywhere in a type.
2681
2681
Infer ,
@@ -2708,10 +2708,10 @@ pub enum InlineAsmOperand<'hir> {
2708
2708
out_expr : Option < & ' hir Expr < ' hir > > ,
2709
2709
} ,
2710
2710
Const {
2711
- anon_const : AnonConst ,
2711
+ anon_const : & ' hir AnonConst ,
2712
2712
} ,
2713
2713
SymFn {
2714
- anon_const : AnonConst ,
2714
+ anon_const : & ' hir AnonConst ,
2715
2715
} ,
2716
2716
SymStatic {
2717
2717
path : QPath < ' hir > ,
@@ -2913,7 +2913,7 @@ pub struct Variant<'hir> {
2913
2913
/// Fields and constructor id of the variant.
2914
2914
pub data : VariantData < ' hir > ,
2915
2915
/// Explicit discriminant (e.g., `Foo = 1`).
2916
- pub disr_expr : Option < AnonConst > ,
2916
+ pub disr_expr : Option < & ' hir AnonConst > ,
2917
2917
/// Span
2918
2918
pub span : Span ,
2919
2919
}
@@ -3833,7 +3833,7 @@ mod size_asserts {
3833
3833
static_assert_size ! ( FnDecl <' _>, 40 ) ;
3834
3834
static_assert_size ! ( ForeignItem <' _>, 72 ) ;
3835
3835
static_assert_size ! ( ForeignItemKind <' _>, 40 ) ;
3836
- static_assert_size ! ( GenericArg <' _>, 32 ) ;
3836
+ static_assert_size ! ( GenericArg <' _>, 24 ) ;
3837
3837
static_assert_size ! ( GenericBound <' _>, 48 ) ;
3838
3838
static_assert_size ! ( Generics <' _>, 56 ) ;
3839
3839
static_assert_size ! ( Impl <' _>, 80 ) ;
0 commit comments