@@ -1601,15 +1601,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
16011601
16021602 if let Some ( ( span, hir_id, def_id) ) = host_param_parts {
16031603 let const_node_id = self . next_node_id ( ) ;
1604- let anon_const =
1604+ let anon_const_did =
16051605 self . create_def ( def_id, const_node_id, kw:: Empty , DefKind :: AnonConst , span) ;
16061606
16071607 let const_id = self . next_id ( ) ;
16081608 let const_expr_id = self . next_id ( ) ;
16091609 let bool_id = self . next_id ( ) ;
16101610
16111611 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) ) ) ;
16131613
16141614 let const_body = self . lower_body ( |this| {
16151615 (
@@ -1624,6 +1624,16 @@ impl<'hir> LoweringContext<'_, 'hir> {
16241624 )
16251625 } ) ;
16261626
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+ } ) ;
16271637 let param = hir:: GenericParam {
16281638 def_id,
16291639 hir_id,
@@ -1647,13 +1657,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
16471657 } ) ,
16481658 ) ) ,
16491659 ) ) ,
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) ,
16571661 is_host_effect : true ,
16581662 synthetic : true ,
16591663 } ,
0 commit comments