@@ -242,6 +242,11 @@ impl<'hir> ConstArg<'hir> {
242
242
}
243
243
}
244
244
245
+ // FIXME: convert to field, where ConstArg has its own HirId
246
+ pub fn hir_id ( & self ) -> HirId {
247
+ self . anon_const_hir_id ( )
248
+ }
249
+
245
250
pub fn anon_const_hir_id ( & self ) -> HirId {
246
251
match self . kind {
247
252
ConstArgKind :: Anon ( anon) => anon. hir_id ,
@@ -288,7 +293,7 @@ impl GenericArg<'_> {
288
293
match self {
289
294
GenericArg :: Lifetime ( l) => l. hir_id ,
290
295
GenericArg :: Type ( t) => t. hir_id ,
291
- GenericArg :: Const ( c) => c. anon_const_hir_id ( ) , // FIXME
296
+ GenericArg :: Const ( c) => c. hir_id ( ) ,
292
297
GenericArg :: Infer ( i) => i. hir_id ,
293
298
}
294
299
}
@@ -1617,15 +1622,14 @@ pub type Lit = Spanned<LitKind>;
1617
1622
#[ derive( Copy , Clone , Debug , HashStable_Generic ) ]
1618
1623
pub enum ArrayLen < ' hir > {
1619
1624
Infer ( InferArg ) ,
1620
- Body ( & ' hir AnonConst ) ,
1625
+ Body ( & ' hir ConstArg < ' hir > ) ,
1621
1626
}
1622
1627
1623
1628
impl ArrayLen < ' _ > {
1624
1629
pub fn hir_id ( & self ) -> HirId {
1625
1630
match self {
1626
- ArrayLen :: Infer ( InferArg { hir_id, .. } ) | ArrayLen :: Body ( AnonConst { hir_id, .. } ) => {
1627
- * hir_id
1628
- }
1631
+ ArrayLen :: Infer ( InferArg { hir_id, .. } ) => * hir_id,
1632
+ ArrayLen :: Body ( ct) => ct. hir_id ( ) ,
1629
1633
}
1630
1634
}
1631
1635
}
0 commit comments