Get rid of clean::TyMethod
It's the same as clean::Function.
This commit is contained in:
parent
9b2b02a840
commit
b3f9795cbb
3 changed files with 4 additions and 14 deletions
|
@ -1120,7 +1120,7 @@ impl Clean<Item> for hir::TraitItem<'_> {
|
||||||
(self.generics.clean(cx), (&*sig.decl, &names[..]).clean(cx))
|
(self.generics.clean(cx), (&*sig.decl, &names[..]).clean(cx))
|
||||||
});
|
});
|
||||||
let (all_types, ret_types) = get_all_types(&generics, &decl, cx);
|
let (all_types, ret_types) = get_all_types(&generics, &decl, cx);
|
||||||
let mut t = TyMethod { header: sig.header, decl, generics, all_types, ret_types };
|
let mut t = Function { header: sig.header, decl, generics, all_types, ret_types };
|
||||||
if t.header.constness == hir::Constness::Const
|
if t.header.constness == hir::Constness::Const
|
||||||
&& is_unstable_const_fn(cx.tcx, local_did.to_def_id()).is_some()
|
&& is_unstable_const_fn(cx.tcx, local_did.to_def_id()).is_some()
|
||||||
{
|
{
|
||||||
|
@ -1249,7 +1249,7 @@ impl Clean<Item> for ty::AssocItem {
|
||||||
ret_types,
|
ret_types,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
TyMethodItem(TyMethod {
|
TyMethodItem(Function {
|
||||||
generics,
|
generics,
|
||||||
decl,
|
decl,
|
||||||
header: hir::FnHeader {
|
header: hir::FnHeader {
|
||||||
|
|
|
@ -264,7 +264,7 @@ crate enum ItemKind {
|
||||||
ImplItem(Impl),
|
ImplItem(Impl),
|
||||||
/// A method signature only. Used for required methods in traits (ie,
|
/// A method signature only. Used for required methods in traits (ie,
|
||||||
/// non-default-methods).
|
/// non-default-methods).
|
||||||
TyMethodItem(TyMethod),
|
TyMethodItem(Function),
|
||||||
/// A method with a body.
|
/// A method with a body.
|
||||||
MethodItem(Method),
|
MethodItem(Method),
|
||||||
StructFieldItem(Type),
|
StructFieldItem(Type),
|
||||||
|
@ -920,15 +920,6 @@ crate struct Method {
|
||||||
crate ret_types: Vec<(Type, TypeKind)>,
|
crate ret_types: Vec<(Type, TypeKind)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
|
||||||
crate struct TyMethod {
|
|
||||||
crate header: hir::FnHeader,
|
|
||||||
crate decl: FnDecl,
|
|
||||||
crate generics: Generics,
|
|
||||||
crate all_types: Vec<(Type, TypeKind)>,
|
|
||||||
crate ret_types: Vec<(Type, TypeKind)>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
crate struct Function {
|
crate struct Function {
|
||||||
crate decl: FnDecl,
|
crate decl: FnDecl,
|
||||||
|
|
|
@ -3752,8 +3752,7 @@ fn render_impl(
|
||||||
(true, " hidden")
|
(true, " hidden")
|
||||||
};
|
};
|
||||||
match item.kind {
|
match item.kind {
|
||||||
clean::MethodItem(clean::Method { .. })
|
clean::MethodItem(_) | clean::TyMethodItem(_) => {
|
||||||
| clean::TyMethodItem(clean::TyMethod { .. }) => {
|
|
||||||
// Only render when the method is not static or we allow static methods
|
// Only render when the method is not static or we allow static methods
|
||||||
if render_method_item {
|
if render_method_item {
|
||||||
let id = cx.derive_id(format!("{}.{}", item_type, name));
|
let id = cx.derive_id(format!("{}.{}", item_type, name));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue