@@ -257,12 +257,12 @@ fn from_clean_item(item: clean::Item, tcx: TyCtxt<'_>) -> ItemEnum {
257
257
StructFieldItem ( f) => ItemEnum :: StructField ( f. into_tcx ( tcx) ) ,
258
258
EnumItem ( e) => ItemEnum :: Enum ( e. into_tcx ( tcx) ) ,
259
259
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) ) ,
262
262
TraitItem ( t) => ItemEnum :: Trait ( ( * t) . into_tcx ( tcx) ) ,
263
263
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) ) ,
266
266
ImplItem ( i) => ItemEnum :: Impl ( ( * i) . into_tcx ( tcx) ) ,
267
267
StaticItem ( s) => ItemEnum :: Static ( s. into_tcx ( tcx) ) ,
268
268
ForeignStaticItem ( s) => ItemEnum :: Static ( s. into_tcx ( tcx) ) ,
@@ -618,6 +618,7 @@ impl FromWithTcx<clean::Impl> for Impl {
618
618
619
619
pub ( crate ) fn from_function (
620
620
function : Box < clean:: Function > ,
621
+ has_body : bool ,
621
622
header : rustc_hir:: FnHeader ,
622
623
tcx : TyCtxt < ' _ > ,
623
624
) -> Function {
@@ -626,20 +627,6 @@ pub(crate) fn from_function(
626
627
decl : decl. into_tcx ( tcx) ,
627
628
generics : generics. into_tcx ( tcx) ,
628
629
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) ,
643
630
has_body,
644
631
}
645
632
}
@@ -759,14 +746,13 @@ impl FromWithTcx<ItemType> for ItemKind {
759
746
Struct => ItemKind :: Struct ,
760
747
Union => ItemKind :: Union ,
761
748
Enum => ItemKind :: Enum ,
762
- Function => ItemKind :: Function ,
749
+ Function | TyMethod | Method => ItemKind :: Function ,
763
750
Typedef => ItemKind :: Typedef ,
764
751
OpaqueTy => ItemKind :: OpaqueTy ,
765
752
Static => ItemKind :: Static ,
766
753
Constant => ItemKind :: Constant ,
767
754
Trait => ItemKind :: Trait ,
768
755
Impl => ItemKind :: Impl ,
769
- TyMethod | Method => ItemKind :: Method ,
770
756
StructField => ItemKind :: StructField ,
771
757
Variant => ItemKind :: Variant ,
772
758
Macro => ItemKind :: Macro ,
0 commit comments