@@ -838,27 +838,28 @@ fn clean_fn_decl_with_args(
838838 FnDecl { inputs : args, output : decl. output . clean ( cx) , c_variadic : decl. c_variadic }
839839}
840840
841- impl < ' tcx > Clean < FnDecl > for ( DefId , ty:: PolyFnSig < ' tcx > ) {
842- fn clean ( & self , cx : & mut DocContext < ' _ > ) -> FnDecl {
843- let ( did, sig) = * self ;
844- let mut names = if did. is_local ( ) { & [ ] } else { cx. tcx . fn_arg_names ( did) } . iter ( ) ;
845-
846- FnDecl {
847- output : Return ( sig. skip_binder ( ) . output ( ) . clean ( cx) ) ,
848- c_variadic : sig. skip_binder ( ) . c_variadic ,
849- inputs : Arguments {
850- values : sig
851- . skip_binder ( )
852- . inputs ( )
853- . iter ( )
854- . map ( |t| Argument {
855- type_ : t. clean ( cx) ,
856- name : names. next ( ) . map_or ( kw:: Empty , |i| i. name ) ,
857- is_const : false ,
858- } )
859- . collect ( ) ,
860- } ,
861- }
841+ fn clean_fn_decl_from_did_and_sig (
842+ cx : & mut DocContext < ' _ > ,
843+ did : DefId ,
844+ sig : ty:: PolyFnSig < ' _ > ,
845+ ) -> FnDecl {
846+ let mut names = if did. is_local ( ) { & [ ] } else { cx. tcx . fn_arg_names ( did) } . iter ( ) ;
847+
848+ FnDecl {
849+ output : Return ( sig. skip_binder ( ) . output ( ) . clean ( cx) ) ,
850+ c_variadic : sig. skip_binder ( ) . c_variadic ,
851+ inputs : Arguments {
852+ values : sig
853+ . skip_binder ( )
854+ . inputs ( )
855+ . iter ( )
856+ . map ( |t| Argument {
857+ type_ : t. clean ( cx) ,
858+ name : names. next ( ) . map_or ( kw:: Empty , |i| i. name ) ,
859+ is_const : false ,
860+ } )
861+ . collect ( ) ,
862+ } ,
862863 }
863864}
864865
@@ -1013,7 +1014,7 @@ impl Clean<Item> for ty::AssocItem {
10131014 tcx. explicit_predicates_of ( self . def_id ) ,
10141015 ) ;
10151016 let sig = tcx. fn_sig ( self . def_id ) ;
1016- let mut decl = ( self . def_id , sig) . clean ( cx ) ;
1017+ let mut decl = clean_fn_decl_from_did_and_sig ( cx , self . def_id , sig) ;
10171018
10181019 if self . fn_has_self_parameter {
10191020 let self_ty = match self . container {
@@ -1407,10 +1408,11 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
14071408 let ty = cx. tcx . lift ( * self ) . expect ( "FnPtr lift failed" ) ;
14081409 let sig = ty. fn_sig ( cx. tcx ) ;
14091410 let def_id = DefId :: local ( CRATE_DEF_INDEX ) ;
1411+ let decl = clean_fn_decl_from_did_and_sig ( cx, def_id, sig) ;
14101412 BareFunction ( box BareFunctionDecl {
14111413 unsafety : sig. unsafety ( ) ,
14121414 generic_params : Vec :: new ( ) ,
1413- decl : ( def_id , sig ) . clean ( cx ) ,
1415+ decl,
14141416 abi : sig. abi ( ) ,
14151417 } )
14161418 }
0 commit comments