@@ -242,6 +242,11 @@ impl<'hir> ConstArg<'hir> {
242242 }
243243 }
244244
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+
245250 pub fn anon_const_hir_id ( & self ) -> HirId {
246251 match self . kind {
247252 ConstArgKind :: Anon ( anon) => anon. hir_id ,
@@ -288,7 +293,7 @@ impl GenericArg<'_> {
288293 match self {
289294 GenericArg :: Lifetime ( l) => l. hir_id ,
290295 GenericArg :: Type ( t) => t. hir_id ,
291- GenericArg :: Const ( c) => c. anon_const_hir_id ( ) , // FIXME
296+ GenericArg :: Const ( c) => c. hir_id ( ) ,
292297 GenericArg :: Infer ( i) => i. hir_id ,
293298 }
294299 }
@@ -1617,15 +1622,14 @@ pub type Lit = Spanned<LitKind>;
16171622#[ derive( Copy , Clone , Debug , HashStable_Generic ) ]
16181623pub enum ArrayLen < ' hir > {
16191624 Infer ( InferArg ) ,
1620- Body ( & ' hir AnonConst ) ,
1625+ Body ( & ' hir ConstArg < ' hir > ) ,
16211626}
16221627
16231628impl ArrayLen < ' _ > {
16241629 pub fn hir_id ( & self ) -> HirId {
16251630 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 ( ) ,
16291633 }
16301634 }
16311635}
0 commit comments