@@ -890,10 +890,10 @@ fn clean_fn_decl_with_args(
890
890
891
891
fn clean_fn_decl_from_did_and_sig (
892
892
cx : & mut DocContext < ' _ > ,
893
- did : DefId ,
893
+ did : Option < DefId > ,
894
894
sig : ty:: PolyFnSig < ' _ > ,
895
895
) -> FnDecl {
896
- let mut names = if did. is_local ( ) { & [ ] } else { cx. tcx . fn_arg_names ( did) } . iter ( ) ;
896
+ let mut names = did. map_or ( & [ ] as & [ _ ] , |did| cx. tcx . fn_arg_names ( did) ) . iter ( ) ;
897
897
898
898
FnDecl {
899
899
output : Return ( sig. skip_binder ( ) . output ( ) . clean ( cx) ) ,
@@ -1067,7 +1067,7 @@ impl Clean<Item> for ty::AssocItem {
1067
1067
tcx. explicit_predicates_of ( self . def_id ) ,
1068
1068
) ;
1069
1069
let sig = tcx. fn_sig ( self . def_id ) ;
1070
- let mut decl = clean_fn_decl_from_did_and_sig ( cx, self . def_id , sig) ;
1070
+ let mut decl = clean_fn_decl_from_did_and_sig ( cx, Some ( self . def_id ) , sig) ;
1071
1071
1072
1072
if self . fn_has_self_parameter {
1073
1073
let self_ty = match self . container {
@@ -1466,8 +1466,7 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
1466
1466
ty:: FnDef ( ..) | ty:: FnPtr ( _) => {
1467
1467
let ty = cx. tcx . lift ( * self ) . expect ( "FnPtr lift failed" ) ;
1468
1468
let sig = ty. fn_sig ( cx. tcx ) ;
1469
- let def_id = DefId :: local ( CRATE_DEF_INDEX ) ;
1470
- let decl = clean_fn_decl_from_did_and_sig ( cx, def_id, sig) ;
1469
+ let decl = clean_fn_decl_from_did_and_sig ( cx, None , sig) ;
1471
1470
BareFunction ( box BareFunctionDecl {
1472
1471
unsafety : sig. unsafety ( ) ,
1473
1472
generic_params : Vec :: new ( ) ,
0 commit comments