@@ -1158,7 +1158,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11581158 None ,
11591159 ) ;
11601160 return GenericArg :: Const ( ConstArg {
1161- hir_id : self . lower_node_id ( ty . id ) ,
1161+ hir_id : self . next_id ( ) ,
11621162 kind : ConstArgKind :: Path ( qpath) ,
11631163 is_desugared_from_effects : false ,
11641164 } ) ;
@@ -1191,15 +1191,15 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11911191 None ,
11921192 ) ;
11931193 return ConstArg {
1194- hir_id : self . lower_node_id ( anon . id ) ,
1194+ hir_id : self . next_id ( ) ,
11951195 kind : ConstArgKind :: Path ( qpath) ,
11961196 is_desugared_from_effects : false ,
11971197 } ;
11981198 }
11991199
12001200 let lowered_anon = self . lower_anon_const ( anon) ;
12011201 ConstArg {
1202- hir_id : lowered_anon . hir_id ,
1202+ hir_id : self . next_id ( ) ,
12031203 kind : ConstArgKind :: Anon ( lowered_anon) ,
12041204 is_desugared_from_effects : false ,
12051205 }
@@ -2599,7 +2599,7 @@ impl<'hir> GenericArgsCtor<'hir> {
25992599 return ;
26002600 }
26012601
2602- let ( hir_id , const_arg_kind) = match constness {
2602+ let const_arg_kind = match constness {
26032603 BoundConstness :: Never => return ,
26042604 BoundConstness :: Always ( span) => {
26052605 let id = lcx. next_node_id ( ) ;
@@ -2620,18 +2620,14 @@ impl<'hir> GenericArgsCtor<'hir> {
26202620 ) ;
26212621
26222622 lcx. children . push ( ( def_id, hir:: MaybeOwner :: NonOwner ( hir_id) ) ) ;
2623- (
2623+ hir:: ConstArgKind :: Anon ( lcx. arena . alloc ( hir:: AnonConst {
2624+ def_id,
26242625 hir_id,
2625- hir:: ConstArgKind :: Anon ( lcx. arena . alloc ( hir:: AnonConst {
2626- def_id,
2627- hir_id,
2628- body,
2629- span,
2630- } ) ) ,
2631- )
2626+ body,
2627+ span,
2628+ } ) )
26322629 }
26332630 BoundConstness :: Maybe ( span) => {
2634- let hir_id = lcx. next_id ( ) ;
26352631 let span = lcx. lower_span ( span) ;
26362632
26372633 let Some ( host_param_id) = lcx. host_param_id else {
@@ -2643,6 +2639,7 @@ impl<'hir> GenericArgsCtor<'hir> {
26432639 } ;
26442640
26452641 let res = Res :: Def ( DefKind :: ConstParam , host_param_id. to_def_id ( ) ) ;
2642+ let hir_id = lcx. next_id ( ) ;
26462643 let path = lcx. arena . alloc ( hir:: Path {
26472644 span,
26482645 res,
@@ -2655,12 +2652,12 @@ impl<'hir> GenericArgsCtor<'hir> {
26552652 )
26562653 ] ,
26572654 } ) ;
2658- ( hir_id , hir:: ConstArgKind :: Path ( hir:: QPath :: Resolved ( None , path) ) )
2655+ hir:: ConstArgKind :: Path ( hir:: QPath :: Resolved ( None , path) )
26592656 }
26602657 } ;
26612658
26622659 self . args . push ( hir:: GenericArg :: Const ( hir:: ConstArg {
2663- hir_id,
2660+ hir_id : lcx . next_id ( ) ,
26642661 kind : const_arg_kind,
26652662 is_desugared_from_effects : true ,
26662663 } ) )
0 commit comments