@@ -956,7 +956,11 @@ fn clean_fn_decl_with_args<'tcx>(
956
956
decl : & hir:: FnDecl < ' tcx > ,
957
957
args : Arguments ,
958
958
) -> FnDecl {
959
- FnDecl { inputs : args, output : decl. output . clean ( cx) , c_variadic : decl. c_variadic }
959
+ let output = match decl. output {
960
+ hir:: FnRetTy :: Return ( typ) => Return ( clean_ty ( typ, cx) ) ,
961
+ hir:: FnRetTy :: DefaultReturn ( ..) => DefaultReturn ,
962
+ } ;
963
+ FnDecl { inputs : args, output, c_variadic : decl. c_variadic }
960
964
}
961
965
962
966
fn clean_fn_decl_from_did_and_sig < ' tcx > (
@@ -991,27 +995,16 @@ fn clean_fn_decl_from_did_and_sig<'tcx>(
991
995
}
992
996
}
993
997
994
- impl < ' tcx > Clean < ' tcx , FnRetTy > for hir:: FnRetTy < ' tcx > {
995
- fn clean ( & self , cx : & mut DocContext < ' tcx > ) -> FnRetTy {
996
- match * self {
997
- Self :: Return ( typ) => Return ( clean_ty ( typ, cx) ) ,
998
- Self :: DefaultReturn ( ..) => DefaultReturn ,
999
- }
1000
- }
1001
- }
1002
-
1003
- impl < ' tcx > Clean < ' tcx , Path > for hir:: TraitRef < ' tcx > {
1004
- fn clean ( & self , cx : & mut DocContext < ' tcx > ) -> Path {
1005
- let path = clean_path ( self . path , cx) ;
1006
- register_res ( cx, path. res ) ;
1007
- path
1008
- }
998
+ fn clean_trait_ref < ' tcx > ( trait_ref : & hir:: TraitRef < ' tcx > , cx : & mut DocContext < ' tcx > ) -> Path {
999
+ let path = clean_path ( trait_ref. path , cx) ;
1000
+ register_res ( cx, path. res ) ;
1001
+ path
1009
1002
}
1010
1003
1011
1004
impl < ' tcx > Clean < ' tcx , PolyTrait > for hir:: PolyTraitRef < ' tcx > {
1012
1005
fn clean ( & self , cx : & mut DocContext < ' tcx > ) -> PolyTrait {
1013
1006
PolyTrait {
1014
- trait_ : self . trait_ref . clean ( cx) ,
1007
+ trait_ : clean_trait_ref ( & self . trait_ref , cx) ,
1015
1008
generic_params : self
1016
1009
. bound_generic_params
1017
1010
. iter ( )
@@ -2000,7 +1993,7 @@ fn clean_impl<'tcx>(
2000
1993
) -> Vec < Item > {
2001
1994
let tcx = cx. tcx ;
2002
1995
let mut ret = Vec :: new ( ) ;
2003
- let trait_ = impl_. of_trait . as_ref ( ) . map ( |t| t . clean ( cx) ) ;
1996
+ let trait_ = impl_. of_trait . as_ref ( ) . map ( |t| clean_trait_ref ( t , cx) ) ;
2004
1997
let items =
2005
1998
impl_. items . iter ( ) . map ( |ii| tcx. hir ( ) . impl_item ( ii. id ) . clean ( cx) ) . collect :: < Vec < _ > > ( ) ;
2006
1999
let def_id = tcx. hir ( ) . local_def_id ( hir_id) ;
0 commit comments