@@ -1510,7 +1510,7 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T
1510
1510
if !lifetime. is_elided ( ) { Some ( clean_lifetime ( * lifetime, cx) ) } else { None } ;
1511
1511
DynTrait ( bounds, lifetime)
1512
1512
}
1513
- TyKind :: BareFn ( barefn) => BareFunction ( Box :: new ( barefn . clean ( cx) ) ) ,
1513
+ TyKind :: BareFn ( barefn) => BareFunction ( Box :: new ( clean_bare_fn_ty ( barefn , cx) ) ) ,
1514
1514
// Rustdoc handles `TyKind::Err`s by turning them into `Type::Infer`s.
1515
1515
TyKind :: Infer | TyKind :: Err => Infer ,
1516
1516
TyKind :: Typeof ( ..) => panic ! ( "unimplemented type {:?}" , ty. kind) ,
@@ -1874,22 +1874,23 @@ fn clean_path_segment<'tcx>(
1874
1874
PathSegment { name : path. ident . name , args : clean_generic_args ( path. args ( ) , cx) }
1875
1875
}
1876
1876
1877
- impl < ' tcx > Clean < ' tcx , BareFunctionDecl > for hir:: BareFnTy < ' tcx > {
1878
- fn clean ( & self , cx : & mut DocContext < ' tcx > ) -> BareFunctionDecl {
1879
- let ( generic_params, decl) = enter_impl_trait ( cx, |cx| {
1880
- // NOTE: generics must be cleaned before args
1881
- let generic_params = self
1882
- . generic_params
1883
- . iter ( )
1884
- . filter ( |p| !is_elided_lifetime ( p) )
1885
- . map ( |x| clean_generic_param ( cx, None , x) )
1886
- . collect ( ) ;
1887
- let args = clean_args_from_types_and_names ( cx, self . decl . inputs , self . param_names ) ;
1888
- let decl = clean_fn_decl_with_args ( cx, self . decl , args) ;
1889
- ( generic_params, decl)
1890
- } ) ;
1891
- BareFunctionDecl { unsafety : self . unsafety , abi : self . abi , decl, generic_params }
1892
- }
1877
+ fn clean_bare_fn_ty < ' tcx > (
1878
+ bare_fn : & hir:: BareFnTy < ' tcx > ,
1879
+ cx : & mut DocContext < ' tcx > ,
1880
+ ) -> BareFunctionDecl {
1881
+ let ( generic_params, decl) = enter_impl_trait ( cx, |cx| {
1882
+ // NOTE: generics must be cleaned before args
1883
+ let generic_params = bare_fn
1884
+ . generic_params
1885
+ . iter ( )
1886
+ . filter ( |p| !is_elided_lifetime ( p) )
1887
+ . map ( |x| clean_generic_param ( cx, None , x) )
1888
+ . collect ( ) ;
1889
+ let args = clean_args_from_types_and_names ( cx, bare_fn. decl . inputs , bare_fn. param_names ) ;
1890
+ let decl = clean_fn_decl_with_args ( cx, bare_fn. decl , args) ;
1891
+ ( generic_params, decl)
1892
+ } ) ;
1893
+ BareFunctionDecl { unsafety : bare_fn. unsafety , abi : bare_fn. abi , decl, generic_params }
1893
1894
}
1894
1895
1895
1896
fn clean_maybe_renamed_item < ' tcx > (
0 commit comments