@@ -1560,15 +1560,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
15601560
15611561 if let Some ( ( span, hir_id, def_id) ) = host_param_parts {
15621562 let const_node_id = self . next_node_id ( ) ;
1563- let anon_const =
1563+ let anon_const_did =
15641564 self . create_def ( def_id, const_node_id, kw:: Empty , DefKind :: AnonConst , span) ;
15651565
15661566 let const_id = self . next_id ( ) ;
15671567 let const_expr_id = self . next_id ( ) ;
15681568 let bool_id = self . next_id ( ) ;
15691569
15701570 self . children . push ( ( def_id, hir:: MaybeOwner :: NonOwner ( hir_id) ) ) ;
1571- self . children . push ( ( anon_const , hir:: MaybeOwner :: NonOwner ( const_id) ) ) ;
1571+ self . children . push ( ( anon_const_did , hir:: MaybeOwner :: NonOwner ( const_id) ) ) ;
15721572
15731573 let const_body = self . lower_body ( |this| {
15741574 (
@@ -1583,6 +1583,17 @@ impl<'hir> LoweringContext<'_, 'hir> {
15831583 )
15841584 } ) ;
15851585
1586+ let default_ac = self . arena . alloc ( hir:: AnonConst {
1587+ def_id : anon_const_did,
1588+ hir_id : const_id,
1589+ body : const_body,
1590+ span,
1591+ } ) ;
1592+ let default_ct = self . arena . alloc ( hir:: ConstArg {
1593+ hir_id : self . next_id ( ) ,
1594+ kind : hir:: ConstArgKind :: Anon ( default_ac) ,
1595+ is_desugared_from_effects : true ,
1596+ } ) ;
15861597 let param = hir:: GenericParam {
15871598 def_id,
15881599 hir_id,
@@ -1606,12 +1617,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
16061617 } ) ,
16071618 ) ) ,
16081619 ) ) ,
1609- default : Some ( self . arena . alloc ( hir:: AnonConst {
1610- def_id : anon_const,
1611- hir_id : const_id,
1612- body : const_body,
1613- span,
1614- } ) ) ,
1620+ default : Some ( default_ct) ,
16151621 is_host_effect : true ,
16161622 } ,
16171623 colon_span : None ,
0 commit comments