@@ -761,8 +761,9 @@ fn clean_fn_or_proc_macro(
761
761
762
762
impl < ' a > Clean < Function > for ( & ' a hir:: FnSig < ' a > , & ' a hir:: Generics < ' a > , hir:: BodyId ) {
763
763
fn clean ( & self , cx : & mut DocContext < ' _ > ) -> Function {
764
- let ( generics, decl) =
765
- enter_impl_trait ( cx, |cx| ( self . 1 . clean ( cx) , ( & * self . 0 . decl , self . 2 ) . clean ( cx) ) ) ;
764
+ let ( generics, decl) = enter_impl_trait ( cx, |cx| {
765
+ ( self . 1 . clean ( cx) , clean_fn_decl_with_args ( cx, & * self . 0 . decl , self . 2 ) )
766
+ } ) ;
766
767
Function { decl, generics, header : self . 0 . header }
767
768
}
768
769
}
@@ -804,16 +805,18 @@ impl<'a> Clean<Arguments> for (&'a [hir::Ty<'a>], hir::BodyId) {
804
805
}
805
806
}
806
807
807
- impl < ' a , A : Copy > Clean < FnDecl > for ( & ' a hir:: FnDecl < ' a > , A )
808
+ fn clean_fn_decl_with_args < ' a , A : Copy > (
809
+ cx : & mut DocContext < ' _ > ,
810
+ decl : & ' a hir:: FnDecl < ' a > ,
811
+ args : A ,
812
+ ) -> FnDecl
808
813
where
809
814
( & ' a [ hir:: Ty < ' a > ] , A ) : Clean < Arguments > ,
810
815
{
811
- fn clean ( & self , cx : & mut DocContext < ' _ > ) -> FnDecl {
812
- FnDecl {
813
- inputs : ( self . 0 . inputs , self . 1 ) . clean ( cx) ,
814
- output : self . 0 . output . clean ( cx) ,
815
- c_variadic : self . 0 . c_variadic ,
816
- }
816
+ FnDecl {
817
+ inputs : ( decl. inputs , args) . clean ( cx) ,
818
+ output : decl. output . clean ( cx) ,
819
+ c_variadic : decl. c_variadic ,
817
820
}
818
821
}
819
822
@@ -894,7 +897,7 @@ impl Clean<Item> for hir::TraitItem<'_> {
894
897
}
895
898
hir:: TraitItemKind :: Fn ( ref sig, hir:: TraitFn :: Required ( names) ) => {
896
899
let ( generics, decl) = enter_impl_trait ( cx, |cx| {
897
- ( self . generics . clean ( cx) , ( sig. decl , names) . clean ( cx ) )
900
+ ( self . generics . clean ( cx) , clean_fn_decl_with_args ( cx , sig. decl , names) )
898
901
} ) ;
899
902
let mut t = Function { header : sig. header , decl, generics } ;
900
903
if t. header . constness == hir:: Constness :: Const
@@ -1728,7 +1731,7 @@ impl Clean<BareFunctionDecl> for hir::BareFnTy<'_> {
1728
1731
fn clean ( & self , cx : & mut DocContext < ' _ > ) -> BareFunctionDecl {
1729
1732
let ( generic_params, decl) = enter_impl_trait ( cx, |cx| {
1730
1733
let generic_params = self . generic_params . iter ( ) . map ( |x| x. clean ( cx) ) . collect ( ) ;
1731
- let decl = ( self . decl , self . param_names ) . clean ( cx ) ;
1734
+ let decl = clean_fn_decl_with_args ( cx , self . decl , self . param_names ) ;
1732
1735
( generic_params, decl)
1733
1736
} ) ;
1734
1737
BareFunctionDecl { unsafety : self . unsafety , abi : self . abi , decl, generic_params }
@@ -2025,8 +2028,9 @@ impl Clean<Item> for (&hir::ForeignItem<'_>, Option<Symbol>) {
2025
2028
let kind = match item. kind {
2026
2029
hir:: ForeignItemKind :: Fn ( decl, names, ref generics) => {
2027
2030
let abi = cx. tcx . hir ( ) . get_foreign_abi ( item. hir_id ( ) ) ;
2028
- let ( generics, decl) =
2029
- enter_impl_trait ( cx, |cx| ( generics. clean ( cx) , ( decl, names) . clean ( cx) ) ) ;
2031
+ let ( generics, decl) = enter_impl_trait ( cx, |cx| {
2032
+ ( generics. clean ( cx) , clean_fn_decl_with_args ( cx, decl, names) )
2033
+ } ) ;
2030
2034
ForeignFunctionItem ( Function {
2031
2035
decl,
2032
2036
generics,
0 commit comments