@@ -1161,7 +1161,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11611161 None ,
11621162 ) ;
11631163 return GenericArg :: Const ( ConstArg {
1164- hir_id : self . lower_node_id ( ty . id ) ,
1164+ hir_id : self . next_id ( ) ,
11651165 kind : ConstArgKind :: Path ( qpath) ,
11661166 is_desugared_from_effects : false ,
11671167 } ) ;
@@ -1194,15 +1194,15 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11941194 None ,
11951195 ) ;
11961196 return ConstArg {
1197- hir_id : self . lower_node_id ( anon . id ) ,
1197+ hir_id : self . next_id ( ) ,
11981198 kind : ConstArgKind :: Path ( qpath) ,
11991199 is_desugared_from_effects : false ,
12001200 } ;
12011201 }
12021202
12031203 let lowered_anon = self . lower_anon_const ( anon) ;
12041204 ConstArg {
1205- hir_id : lowered_anon . hir_id ,
1205+ hir_id : self . next_id ( ) ,
12061206 kind : ConstArgKind :: Anon ( lowered_anon) ,
12071207 is_desugared_from_effects : false ,
12081208 }
@@ -2602,7 +2602,7 @@ impl<'hir> GenericArgsCtor<'hir> {
26022602 return ;
26032603 }
26042604
2605- let ( hir_id , const_arg_kind) = match constness {
2605+ let const_arg_kind = match constness {
26062606 BoundConstness :: Never => return ,
26072607 BoundConstness :: Always ( span) => {
26082608 let id = lcx. next_node_id ( ) ;
@@ -2623,18 +2623,14 @@ impl<'hir> GenericArgsCtor<'hir> {
26232623 ) ;
26242624
26252625 lcx. children . push ( ( def_id, hir:: MaybeOwner :: NonOwner ( hir_id) ) ) ;
2626- (
2626+ hir:: ConstArgKind :: Anon ( lcx. arena . alloc ( hir:: AnonConst {
2627+ def_id,
26272628 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+ } ) )
26352632 }
26362633 BoundConstness :: Maybe ( span) => {
2637- let hir_id = lcx. next_id ( ) ;
26382634 let span = lcx. lower_span ( span) ;
26392635
26402636 let Some ( host_param_id) = lcx. host_param_id else {
@@ -2646,6 +2642,7 @@ impl<'hir> GenericArgsCtor<'hir> {
26462642 } ;
26472643
26482644 let res = Res :: Def ( DefKind :: ConstParam , host_param_id. to_def_id ( ) ) ;
2645+ let hir_id = lcx. next_id ( ) ;
26492646 let path = lcx. arena . alloc ( hir:: Path {
26502647 span,
26512648 res,
@@ -2658,12 +2655,12 @@ impl<'hir> GenericArgsCtor<'hir> {
26582655 )
26592656 ] ,
26602657 } ) ;
2661- ( hir_id , hir:: ConstArgKind :: Path ( hir:: QPath :: Resolved ( None , path) ) )
2658+ hir:: ConstArgKind :: Path ( hir:: QPath :: Resolved ( None , path) )
26622659 }
26632660 } ;
26642661
26652662 self . args . push ( hir:: GenericArg :: Const ( hir:: ConstArg {
2666- hir_id,
2663+ hir_id : lcx . next_id ( ) ,
26672664 kind : const_arg_kind,
26682665 is_desugared_from_effects : true ,
26692666 } ) )
0 commit comments