@@ -1601,15 +1601,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
1601
1601
1602
1602
if let Some ( ( span, hir_id, def_id) ) = host_param_parts {
1603
1603
let const_node_id = self . next_node_id ( ) ;
1604
- let anon_const =
1604
+ let anon_const_did =
1605
1605
self . create_def ( def_id, const_node_id, kw:: Empty , DefKind :: AnonConst , span) ;
1606
1606
1607
1607
let const_id = self . next_id ( ) ;
1608
1608
let const_expr_id = self . next_id ( ) ;
1609
1609
let bool_id = self . next_id ( ) ;
1610
1610
1611
1611
self . children . push ( ( def_id, hir:: MaybeOwner :: NonOwner ( hir_id) ) ) ;
1612
- self . children . push ( ( anon_const , hir:: MaybeOwner :: NonOwner ( const_id) ) ) ;
1612
+ self . children . push ( ( anon_const_did , hir:: MaybeOwner :: NonOwner ( const_id) ) ) ;
1613
1613
1614
1614
let const_body = self . lower_body ( |this| {
1615
1615
(
@@ -1624,6 +1624,16 @@ impl<'hir> LoweringContext<'_, 'hir> {
1624
1624
)
1625
1625
} ) ;
1626
1626
1627
+ let default_ac = self . arena . alloc ( hir:: AnonConst {
1628
+ def_id : anon_const_did,
1629
+ hir_id : const_id,
1630
+ body : const_body,
1631
+ span,
1632
+ } ) ;
1633
+ let default_ct = self . arena . alloc ( hir:: ConstArg {
1634
+ kind : hir:: ConstArgKind :: Anon ( default_ac) ,
1635
+ is_desugared_from_effects : true ,
1636
+ } ) ;
1627
1637
let param = hir:: GenericParam {
1628
1638
def_id,
1629
1639
hir_id,
@@ -1647,13 +1657,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
1647
1657
} ) ,
1648
1658
) ) ,
1649
1659
) ) ,
1650
- // FIXME(effects) we might not need a default.
1651
- default : Some ( self . arena . alloc ( hir:: AnonConst {
1652
- def_id : anon_const,
1653
- hir_id : const_id,
1654
- body : const_body,
1655
- span,
1656
- } ) ) ,
1660
+ default : Some ( default_ct) ,
1657
1661
is_host_effect : true ,
1658
1662
synthetic : true ,
1659
1663
} ,
0 commit comments