@@ -1551,15 +1551,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
15511551
15521552 if let Some ( ( span, hir_id, def_id) ) = host_param_parts {
15531553 let const_node_id = self . next_node_id ( ) ;
1554- let anon_const =
1554+ let anon_const_did =
15551555 self . create_def ( def_id, const_node_id, kw:: Empty , DefKind :: AnonConst , span) ;
15561556
15571557 let const_id = self . next_id ( ) ;
15581558 let const_expr_id = self . next_id ( ) ;
15591559 let bool_id = self . next_id ( ) ;
15601560
15611561 self . children . push ( ( def_id, hir:: MaybeOwner :: NonOwner ( hir_id) ) ) ;
1562- self . children . push ( ( anon_const , hir:: MaybeOwner :: NonOwner ( const_id) ) ) ;
1562+ self . children . push ( ( anon_const_did , hir:: MaybeOwner :: NonOwner ( const_id) ) ) ;
15631563
15641564 let const_body = self . lower_body ( |this| {
15651565 (
@@ -1574,6 +1574,17 @@ impl<'hir> LoweringContext<'_, 'hir> {
15741574 )
15751575 } ) ;
15761576
1577+ let default_ac = self . arena . alloc ( hir:: AnonConst {
1578+ def_id : anon_const_did,
1579+ hir_id : const_id,
1580+ body : const_body,
1581+ span,
1582+ } ) ;
1583+ let default_ct = self . arena . alloc ( hir:: ConstArg {
1584+ hir_id : self . next_id ( ) ,
1585+ kind : hir:: ConstArgKind :: Anon ( default_ac) ,
1586+ is_desugared_from_effects : true ,
1587+ } ) ;
15771588 let param = hir:: GenericParam {
15781589 def_id,
15791590 hir_id,
@@ -1597,12 +1608,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
15971608 } ) ,
15981609 ) ) ,
15991610 ) ) ,
1600- default : Some ( self . arena . alloc ( hir:: AnonConst {
1601- def_id : anon_const,
1602- hir_id : const_id,
1603- body : const_body,
1604- span,
1605- } ) ) ,
1611+ default : Some ( default_ct) ,
16061612 is_host_effect : true ,
16071613 } ,
16081614 colon_span : None ,
0 commit comments