This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-16
lines changed Expand file tree Collapse file tree 1 file changed +17
-16
lines changed Original file line number Diff line number Diff line change @@ -783,7 +783,7 @@ fn clean_function(
783783 let ( generics, decl) = enter_impl_trait ( cx, |cx| {
784784 // NOTE: generics must be cleaned before args
785785 let generics = generics. clean ( cx) ;
786- let args = ( sig. decl . inputs , body_id) . clean ( cx ) ;
786+ let args = clean_args_from_types_and_body_id ( cx , sig. decl . inputs , body_id) ;
787787 let decl = clean_fn_decl_with_args ( cx, sig. decl , args) ;
788788 ( generics, decl)
789789 } ) ;
@@ -810,22 +810,23 @@ fn clean_args_from_types_and_names(
810810 }
811811}
812812
813- impl < ' a > Clean < Arguments > for ( & ' a [ hir:: Ty < ' a > ] , hir:: BodyId ) {
814- fn clean ( & self , cx : & mut DocContext < ' _ > ) -> Arguments {
815- let body = cx. tcx . hir ( ) . body ( self . 1 ) ;
813+ fn clean_args_from_types_and_body_id (
814+ cx : & mut DocContext < ' _ > ,
815+ types : & [ hir:: Ty < ' _ > ] ,
816+ body_id : hir:: BodyId ,
817+ ) -> Arguments {
818+ let body = cx. tcx . hir ( ) . body ( body_id) ;
816819
817- Arguments {
818- values : self
819- . 0
820- . iter ( )
821- . enumerate ( )
822- . map ( |( i, ty) | Argument {
823- name : name_from_pat ( body. params [ i] . pat ) ,
824- type_ : ty. clean ( cx) ,
825- is_const : false ,
826- } )
827- . collect ( ) ,
828- }
820+ Arguments {
821+ values : types
822+ . iter ( )
823+ . enumerate ( )
824+ . map ( |( i, ty) | Argument {
825+ name : name_from_pat ( body. params [ i] . pat ) ,
826+ type_ : ty. clean ( cx) ,
827+ is_const : false ,
828+ } )
829+ . collect ( ) ,
829830 }
830831}
831832
You can’t perform that action at this time.
0 commit comments