@@ -883,14 +883,12 @@ impl<'a, 'tcx> Clean<Generics> for (&'a ty::Generics, ty::GenericPredicates<'tcx
883
883
}
884
884
}
885
885
886
- impl < ' a > Clean < Method >
887
- for ( & ' a hir:: FnSig < ' a > , & ' a hir:: Generics < ' a > , hir:: BodyId , Option < hir:: Defaultness > )
888
- {
889
- fn clean ( & self , cx : & DocContext < ' _ > ) -> Method {
886
+ impl < ' a > Clean < Function > for ( & ' a hir:: FnSig < ' a > , & ' a hir:: Generics < ' a > , hir:: BodyId ) {
887
+ fn clean ( & self , cx : & DocContext < ' _ > ) -> Function {
890
888
let ( generics, decl) =
891
889
enter_impl_trait ( cx, || ( self . 1 . clean ( cx) , ( & * self . 0 . decl , self . 2 ) . clean ( cx) ) ) ;
892
890
let ( all_types, ret_types) = get_all_types ( & generics, & decl, cx) ;
893
- Method { decl, generics, header : self . 0 . header , defaultness : self . 3 , all_types, ret_types }
891
+ Function { decl, generics, header : self . 0 . header , all_types, ret_types }
894
892
}
895
893
}
896
894
@@ -1107,13 +1105,13 @@ impl Clean<Item> for hir::TraitItem<'_> {
1107
1105
AssocConstItem ( ty. clean ( cx) , default. map ( |e| print_const_expr ( cx, e) ) )
1108
1106
}
1109
1107
hir:: TraitItemKind :: Fn ( ref sig, hir:: TraitFn :: Provided ( body) ) => {
1110
- let mut m = ( sig, & self . generics , body, None ) . clean ( cx) ;
1108
+ let mut m = ( sig, & self . generics , body) . clean ( cx) ;
1111
1109
if m. header . constness == hir:: Constness :: Const
1112
1110
&& is_unstable_const_fn ( cx. tcx , local_did. to_def_id ( ) ) . is_some ( )
1113
1111
{
1114
1112
m. header . constness = hir:: Constness :: NotConst ;
1115
1113
}
1116
- MethodItem ( m)
1114
+ MethodItem ( m, None )
1117
1115
}
1118
1116
hir:: TraitItemKind :: Fn ( ref sig, hir:: TraitFn :: Required ( ref names) ) => {
1119
1117
let ( generics, decl) = enter_impl_trait ( cx, || {
@@ -1153,13 +1151,13 @@ impl Clean<Item> for hir::ImplItem<'_> {
1153
1151
AssocConstItem ( ty. clean ( cx) , Some ( print_const_expr ( cx, expr) ) )
1154
1152
}
1155
1153
hir:: ImplItemKind :: Fn ( ref sig, body) => {
1156
- let mut m = ( sig, & self . generics , body, Some ( self . defaultness ) ) . clean ( cx) ;
1154
+ let mut m = ( sig, & self . generics , body) . clean ( cx) ;
1157
1155
if m. header . constness == hir:: Constness :: Const
1158
1156
&& is_unstable_const_fn ( cx. tcx , local_did. to_def_id ( ) ) . is_some ( )
1159
1157
{
1160
1158
m. header . constness = hir:: Constness :: NotConst ;
1161
1159
}
1162
- MethodItem ( m)
1160
+ MethodItem ( m, Some ( self . defaultness ) )
1163
1161
}
1164
1162
hir:: ImplItemKind :: TyAlias ( ref ty) => {
1165
1163
let type_ = ty. clean ( cx) ;
@@ -1235,19 +1233,21 @@ impl Clean<Item> for ty::AssocItem {
1235
1233
ty:: ImplContainer ( _) => Some ( self . defaultness ) ,
1236
1234
ty:: TraitContainer ( _) => None ,
1237
1235
} ;
1238
- MethodItem ( Method {
1239
- generics,
1240
- decl,
1241
- header : hir:: FnHeader {
1242
- unsafety : sig. unsafety ( ) ,
1243
- abi : sig. abi ( ) ,
1244
- constness,
1245
- asyncness,
1236
+ MethodItem (
1237
+ Function {
1238
+ generics,
1239
+ decl,
1240
+ header : hir:: FnHeader {
1241
+ unsafety : sig. unsafety ( ) ,
1242
+ abi : sig. abi ( ) ,
1243
+ constness,
1244
+ asyncness,
1245
+ } ,
1246
+ all_types,
1247
+ ret_types,
1246
1248
} ,
1247
1249
defaultness,
1248
- all_types,
1249
- ret_types,
1250
- } )
1250
+ )
1251
1251
} else {
1252
1252
TyMethodItem ( Function {
1253
1253
generics,
0 commit comments