@@ -1479,24 +1479,27 @@ fn rendered_precise_capturing_args<'tcx>(
14791479
14801480fn const_param_default < ' tcx > (
14811481 tcx : TyCtxt < ' tcx > ,
1482- def_id : LocalDefId ,
1482+ local_def_id : LocalDefId ,
14831483) -> ty:: EarlyBinder < ' tcx , Const < ' tcx > > {
14841484 let hir:: Node :: GenericParam ( hir:: GenericParam {
14851485 kind : hir:: GenericParamKind :: Const { default : Some ( default_ct) , .. } ,
14861486 ..
1487- } ) = tcx. hir_node_by_def_id ( def_id )
1487+ } ) = tcx. hir_node_by_def_id ( local_def_id )
14881488 else {
14891489 span_bug ! (
1490- tcx. def_span( def_id ) ,
1490+ tcx. def_span( local_def_id ) ,
14911491 "`const_param_default` expected a generic parameter with a constant"
14921492 )
14931493 } ;
1494- let icx = ItemCtxt :: new ( tcx, def_id) ;
1495- let identity_args = ty:: GenericArgs :: identity_for_item ( tcx, def_id) ;
1496- let ct = icx. lowerer ( ) . lower_const_arg (
1497- default_ct,
1498- FeedConstTy :: with_type_of ( tcx, def_id. to_def_id ( ) , identity_args) ,
1499- ) ;
1494+
1495+ let icx = ItemCtxt :: new ( tcx, local_def_id) ;
1496+
1497+ let def_id = local_def_id. to_def_id ( ) ;
1498+ let identity_args = ty:: GenericArgs :: identity_for_item ( tcx, tcx. parent ( def_id) ) ;
1499+
1500+ let ct = icx
1501+ . lowerer ( )
1502+ . lower_const_arg ( default_ct, FeedConstTy :: with_type_of ( tcx, def_id, identity_args) ) ;
15001503 ty:: EarlyBinder :: bind ( ct)
15011504}
15021505
0 commit comments