@@ -257,12 +257,12 @@ fn from_clean_item(item: clean::Item, tcx: TyCtxt<'_>) -> ItemEnum {
257257 StructFieldItem ( f) => ItemEnum :: StructField ( f. into_tcx ( tcx) ) ,
258258 EnumItem ( e) => ItemEnum :: Enum ( e. into_tcx ( tcx) ) ,
259259 VariantItem ( v) => ItemEnum :: Variant ( v. into_tcx ( tcx) ) ,
260- FunctionItem ( f) => ItemEnum :: Function ( from_function ( f, header. unwrap ( ) , tcx) ) ,
261- ForeignFunctionItem ( f) => ItemEnum :: Function ( from_function ( f, header. unwrap ( ) , tcx) ) ,
260+ FunctionItem ( f) => ItemEnum :: Function ( from_function ( f, true , header. unwrap ( ) , tcx) ) ,
261+ ForeignFunctionItem ( f) => ItemEnum :: Function ( from_function ( f, false , header. unwrap ( ) , tcx) ) ,
262262 TraitItem ( t) => ItemEnum :: Trait ( ( * t) . into_tcx ( tcx) ) ,
263263 TraitAliasItem ( t) => ItemEnum :: TraitAlias ( t. into_tcx ( tcx) ) ,
264- MethodItem ( m, _) => ItemEnum :: Method ( from_function_method ( m, true , header. unwrap ( ) , tcx) ) ,
265- TyMethodItem ( m) => ItemEnum :: Method ( from_function_method ( m, false , header. unwrap ( ) , tcx) ) ,
264+ MethodItem ( m, _) => ItemEnum :: Function ( from_function ( m, true , header. unwrap ( ) , tcx) ) ,
265+ TyMethodItem ( m) => ItemEnum :: Function ( from_function ( m, false , header. unwrap ( ) , tcx) ) ,
266266 ImplItem ( i) => ItemEnum :: Impl ( ( * i) . into_tcx ( tcx) ) ,
267267 StaticItem ( s) => ItemEnum :: Static ( s. into_tcx ( tcx) ) ,
268268 ForeignStaticItem ( s) => ItemEnum :: Static ( s. into_tcx ( tcx) ) ,
@@ -618,6 +618,7 @@ impl FromWithTcx<clean::Impl> for Impl {
618618
619619pub ( crate ) fn from_function (
620620 function : Box < clean:: Function > ,
621+ has_body : bool ,
621622 header : rustc_hir:: FnHeader ,
622623 tcx : TyCtxt < ' _ > ,
623624) -> Function {
@@ -626,20 +627,6 @@ pub(crate) fn from_function(
626627 decl : decl. into_tcx ( tcx) ,
627628 generics : generics. into_tcx ( tcx) ,
628629 header : from_fn_header ( & header) ,
629- }
630- }
631-
632- pub ( crate ) fn from_function_method (
633- function : Box < clean:: Function > ,
634- has_body : bool ,
635- header : rustc_hir:: FnHeader ,
636- tcx : TyCtxt < ' _ > ,
637- ) -> Method {
638- let clean:: Function { decl, generics } = * function;
639- Method {
640- decl : decl. into_tcx ( tcx) ,
641- generics : generics. into_tcx ( tcx) ,
642- header : from_fn_header ( & header) ,
643630 has_body,
644631 }
645632}
@@ -759,14 +746,13 @@ impl FromWithTcx<ItemType> for ItemKind {
759746 Struct => ItemKind :: Struct ,
760747 Union => ItemKind :: Union ,
761748 Enum => ItemKind :: Enum ,
762- Function => ItemKind :: Function ,
749+ Function | TyMethod | Method => ItemKind :: Function ,
763750 Typedef => ItemKind :: Typedef ,
764751 OpaqueTy => ItemKind :: OpaqueTy ,
765752 Static => ItemKind :: Static ,
766753 Constant => ItemKind :: Constant ,
767754 Trait => ItemKind :: Trait ,
768755 Impl => ItemKind :: Impl ,
769- TyMethod | Method => ItemKind :: Method ,
770756 StructField => ItemKind :: StructField ,
771757 Variant => ItemKind :: Variant ,
772758 Macro => ItemKind :: Macro ,
0 commit comments