about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2020-11-16 22:53:10 -0500
committerJoshua Nelson <jyn514@gmail.com>2020-11-16 22:53:10 -0500
commitb3f9795cbb498ad75bcfa0c287774a936c09dd8d (patch)
tree353c39f254a02d1cd5207c0d52590315c811efe3 /src
parent9b2b02a840f358bcadef5c3ae861d2852da20b3d (diff)
downloadrust-b3f9795cbb498ad75bcfa0c287774a936c09dd8d.tar.gz
rust-b3f9795cbb498ad75bcfa0c287774a936c09dd8d.zip
Get rid of clean::TyMethod
It's the same as clean::Function.
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/clean/mod.rs4
-rw-r--r--src/librustdoc/clean/types.rs11
-rw-r--r--src/librustdoc/html/render/mod.rs3
3 files changed, 4 insertions, 14 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs
index daca4f8a933..17dd88392fe 100644
--- a/src/librustdoc/clean/mod.rs
+++ b/src/librustdoc/clean/mod.rs
@@ -1120,7 +1120,7 @@ impl Clean<Item> for hir::TraitItem<'_> {
                     (self.generics.clean(cx), (&*sig.decl, &names[..]).clean(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
                     && 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,
                     })
                 } else {
-                    TyMethodItem(TyMethod {
+                    TyMethodItem(Function {
                         generics,
                         decl,
                         header: hir::FnHeader {
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs
index 9dd8415341e..032a8b937cb 100644
--- a/src/librustdoc/clean/types.rs
+++ b/src/librustdoc/clean/types.rs
@@ -264,7 +264,7 @@ crate enum ItemKind {
     ImplItem(Impl),
     /// A method signature only. Used for required methods in traits (ie,
     /// non-default-methods).
-    TyMethodItem(TyMethod),
+    TyMethodItem(Function),
     /// A method with a body.
     MethodItem(Method),
     StructFieldItem(Type),
@@ -921,15 +921,6 @@ crate struct Method {
 }
 
 #[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)]
 crate struct Function {
     crate decl: FnDecl,
     crate generics: Generics,
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index 78822e678d4..4c71906f586 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -3752,8 +3752,7 @@ fn render_impl(
                 (true, " hidden")
             };
         match item.kind {
-            clean::MethodItem(clean::Method { .. })
-            | clean::TyMethodItem(clean::TyMethod { .. }) => {
+            clean::MethodItem(_) | clean::TyMethodItem(_) => {
                 // Only render when the method is not static or we allow static methods
                 if render_method_item {
                     let id = cx.derive_id(format!("{}.{}", item_type, name));