From a97d65d6e474e86cad99cd833a5cd2ba32eb678f Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Sat, 18 Jul 2020 16:48:59 -0400 Subject: [PATCH] rustdoc: Rename misleading function - `is_associated` -> `is_type_alias` `is_associated` is not a good name for what this is doing. If you look at https://github.com/rust-lang/rust/pull/74489/files#diff-6a301d597807ee441a41e7237800563dR296, is_associated() and as_assoc_kind() do completely different things, but from the name it sounds like they're similar. --- src/librustdoc/clean/types.rs | 2 +- src/librustdoc/html/render/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 3eac5bbda00..4640b4ebf46 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -282,7 +282,7 @@ pub enum ItemEnum { } impl ItemEnum { - pub fn is_associated(&self) -> bool { + pub fn is_type_alias(&self) -> bool { match *self { ItemEnum::TypedefItem(_, _) | ItemEnum::AssocTypeItem(_, _) => true, _ => false, diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index bd919205dd1..d17961521c8 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -3612,7 +3612,7 @@ fn render_impl( }; let (is_hidden, extra_class) = - if (trait_.is_none() || item.doc_value().is_some() || item.inner.is_associated()) + if (trait_.is_none() || item.doc_value().is_some() || item.inner.is_type_alias()) && !is_default_item { (false, "")