about summary refs log tree commit diff
path: root/src/librustdoc/html/render
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2020-11-17 16:13:57 +0100
committerGitHub <noreply@github.com>2020-11-17 16:13:57 +0100
commit3d63f25edfc39efc6461aa62803a5160af397edd (patch)
treeb8800d7a08d2095f1af5acf8978d9dd93553b31c /src/librustdoc/html/render
parent53ddb73fd31b7b1af1332f49dca229fbaa148683 (diff)
parent2a991e18acf42c936612d5ff78e08c8301a168a0 (diff)
downloadrust-3d63f25edfc39efc6461aa62803a5160af397edd.tar.gz
rust-3d63f25edfc39efc6461aa62803a5160af397edd.zip
Rollup merge of #79125 - jyn514:fewer-types, r=GuillaumeGomez
Get rid of clean::{Method, TyMethod}

They're redundant and almost the same as `clean::Function`.

I needed this for https://github.com/rust-lang/rust/pull/78082, although I forget why.

r? `@GuillaumeGomez`
Diffstat (limited to 'src/librustdoc/html/render')
-rw-r--r--src/librustdoc/html/render/cache.rs2
-rw-r--r--src/librustdoc/html/render/mod.rs13
2 files changed, 9 insertions, 6 deletions
diff --git a/src/librustdoc/html/render/cache.rs b/src/librustdoc/html/render/cache.rs
index cef9b8952dd..085ca01f58d 100644
--- a/src/librustdoc/html/render/cache.rs
+++ b/src/librustdoc/html/render/cache.rs
@@ -167,7 +167,7 @@ crate fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
 crate fn get_index_search_type(item: &clean::Item) -> Option<IndexItemFunctionType> {
     let (all_types, ret_types) = match item.kind {
         clean::FunctionItem(ref f) => (&f.all_types, &f.ret_types),
-        clean::MethodItem(ref m) => (&m.all_types, &m.ret_types),
+        clean::MethodItem(ref m, _) => (&m.all_types, &m.ret_types),
         clean::TyMethodItem(ref m) => (&m.all_types, &m.ret_types),
         _ => return None,
     };
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index 78822e678d4..7022cde459c 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -2589,7 +2589,9 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait,
             for (pos, m) in provided.iter().enumerate() {
                 render_assoc_item(w, m, AssocItemLink::Anchor(None), ItemType::Trait);
                 match m.kind {
-                    clean::MethodItem(ref inner) if !inner.generics.where_predicates.is_empty() => {
+                    clean::MethodItem(ref inner, _)
+                        if !inner.generics.where_predicates.is_empty() =>
+                    {
                         write!(w, ",\n    {{ ... }}\n");
                     }
                     _ => {
@@ -2968,7 +2970,9 @@ fn render_assoc_item(
     match item.kind {
         clean::StrippedItem(..) => {}
         clean::TyMethodItem(ref m) => method(w, item, m.header, &m.generics, &m.decl, link, parent),
-        clean::MethodItem(ref m) => method(w, item, m.header, &m.generics, &m.decl, link, parent),
+        clean::MethodItem(ref m, _) => {
+            method(w, item, m.header, &m.generics, &m.decl, link, parent)
+        }
         clean::AssocConstItem(ref ty, ref default) => assoc_const(
             w,
             item,
@@ -3545,7 +3549,7 @@ fn render_deref_methods(
 
 fn should_render_item(item: &clean::Item, deref_mut_: bool) -> bool {
     let self_type_opt = match item.kind {
-        clean::MethodItem(ref method) => method.decl.self_type(),
+        clean::MethodItem(ref method, _) => method.decl.self_type(),
         clean::TyMethodItem(ref method) => method.decl.self_type(),
         _ => None,
     };
@@ -3752,8 +3756,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));