@@ -1161,7 +1161,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1161
1161
None ,
1162
1162
) ;
1163
1163
return GenericArg :: Const ( ConstArg {
1164
- hir_id : self . lower_node_id ( ty . id ) ,
1164
+ hir_id : self . next_id ( ) ,
1165
1165
kind : ConstArgKind :: Path ( qpath) ,
1166
1166
is_desugared_from_effects : false ,
1167
1167
} ) ;
@@ -1194,15 +1194,15 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1194
1194
None ,
1195
1195
) ;
1196
1196
return ConstArg {
1197
- hir_id : self . lower_node_id ( anon . id ) ,
1197
+ hir_id : self . next_id ( ) ,
1198
1198
kind : ConstArgKind :: Path ( qpath) ,
1199
1199
is_desugared_from_effects : false ,
1200
1200
} ;
1201
1201
}
1202
1202
1203
1203
let lowered_anon = self . lower_anon_const ( anon) ;
1204
1204
ConstArg {
1205
- hir_id : lowered_anon . hir_id ,
1205
+ hir_id : self . next_id ( ) ,
1206
1206
kind : ConstArgKind :: Anon ( lowered_anon) ,
1207
1207
is_desugared_from_effects : false ,
1208
1208
}
@@ -2602,7 +2602,7 @@ impl<'hir> GenericArgsCtor<'hir> {
2602
2602
return ;
2603
2603
}
2604
2604
2605
- let ( hir_id , const_arg_kind) = match constness {
2605
+ let const_arg_kind = match constness {
2606
2606
BoundConstness :: Never => return ,
2607
2607
BoundConstness :: Always ( span) => {
2608
2608
let id = lcx. next_node_id ( ) ;
@@ -2623,18 +2623,14 @@ impl<'hir> GenericArgsCtor<'hir> {
2623
2623
) ;
2624
2624
2625
2625
lcx. children . push ( ( def_id, hir:: MaybeOwner :: NonOwner ( hir_id) ) ) ;
2626
- (
2626
+ hir:: ConstArgKind :: Anon ( lcx. arena . alloc ( hir:: AnonConst {
2627
+ def_id,
2627
2628
hir_id,
2628
- hir:: ConstArgKind :: Anon ( lcx. arena . alloc ( hir:: AnonConst {
2629
- def_id,
2630
- hir_id,
2631
- body,
2632
- span,
2633
- } ) ) ,
2634
- )
2629
+ body,
2630
+ span,
2631
+ } ) )
2635
2632
}
2636
2633
BoundConstness :: Maybe ( span) => {
2637
- let hir_id = lcx. next_id ( ) ;
2638
2634
let span = lcx. lower_span ( span) ;
2639
2635
2640
2636
let Some ( host_param_id) = lcx. host_param_id else {
@@ -2646,6 +2642,7 @@ impl<'hir> GenericArgsCtor<'hir> {
2646
2642
} ;
2647
2643
2648
2644
let res = Res :: Def ( DefKind :: ConstParam , host_param_id. to_def_id ( ) ) ;
2645
+ let hir_id = lcx. next_id ( ) ;
2649
2646
let path = lcx. arena . alloc ( hir:: Path {
2650
2647
span,
2651
2648
res,
@@ -2658,12 +2655,12 @@ impl<'hir> GenericArgsCtor<'hir> {
2658
2655
)
2659
2656
] ,
2660
2657
} ) ;
2661
- ( hir_id , hir:: ConstArgKind :: Path ( hir:: QPath :: Resolved ( None , path) ) )
2658
+ hir:: ConstArgKind :: Path ( hir:: QPath :: Resolved ( None , path) )
2662
2659
}
2663
2660
} ;
2664
2661
2665
2662
self . args . push ( hir:: GenericArg :: Const ( hir:: ConstArg {
2666
- hir_id,
2663
+ hir_id : lcx . next_id ( ) ,
2667
2664
kind : const_arg_kind,
2668
2665
is_desugared_from_effects : true ,
2669
2666
} ) )
0 commit comments