diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-08-29 17:13:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-29 17:13:57 +0200 |
| commit | 1ea8fc587cc7166f901e05d991d5dae75ec1d101 (patch) | |
| tree | ec23ffaf0dad27788be60201e169f7220f6dadf9 /src/librustdoc/html | |
| parent | 7445622bcb515c822a2fc6e8c57c90478c1a56bb (diff) | |
| parent | f7656b65764bf2134ffdd605bc182263c79fc508 (diff) | |
| download | rust-1ea8fc587cc7166f901e05d991d5dae75ec1d101.tar.gz rust-1ea8fc587cc7166f901e05d991d5dae75ec1d101.zip | |
Rollup merge of #62734 - GuillaumeGomez:hide-default-methods, r=Mark-Simulacrum
Hide trait default methods Fixes #62499. However, the question remains: do we want to extend it to this point or not? r? @QuietMisdreavus
Diffstat (limited to 'src/librustdoc/html')
| -rw-r--r-- | src/librustdoc/html/render.rs | 25 | ||||
| -rw-r--r-- | src/librustdoc/html/static/main.js | 2 |
2 files changed, 15 insertions, 12 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 2a4a2fcea58..d5c47a15948 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -2405,13 +2405,14 @@ fn document(w: &mut fmt::Formatter<'_>, cx: &Context, item: &clean::Item) -> fmt } /// Render md_text as markdown. -fn render_markdown(w: &mut fmt::Formatter<'_>, - cx: &Context, - md_text: &str, - links: Vec<(String, String)>, - prefix: &str, - is_hidden: bool) - -> fmt::Result { +fn render_markdown( + w: &mut fmt::Formatter<'_>, + cx: &Context, + md_text: &str, + links: Vec<(String, String)>, + prefix: &str, + is_hidden: bool, +) -> fmt::Result { let mut ids = cx.id_map.borrow_mut(); write!(w, "<div class='docblock{}'>{}{}</div>", if is_hidden { " hidden" } else { "" }, @@ -2425,7 +2426,8 @@ fn document_short( cx: &Context, item: &clean::Item, link: AssocItemLink<'_>, - prefix: &str, is_hidden: bool + prefix: &str, + is_hidden: bool, ) -> fmt::Result { if let Some(s) = item.doc_value() { let markdown = if s.contains('\n') { @@ -4084,9 +4086,10 @@ fn render_impl(w: &mut fmt::Formatter<'_>, cx: &Context, i: &Impl, link: AssocIt RenderMode::ForDeref { mut_: deref_mut_ } => should_render_item(&item, deref_mut_), }; - let (is_hidden, extra_class) = if trait_.is_none() || - item.doc_value().is_some() || - item.inner.is_associated() { + let (is_hidden, extra_class) = if (trait_.is_none() || + item.doc_value().is_some() || + item.inner.is_associated()) && + !is_default_item { (false, "") } else { (true, " hidden") diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 4e5ffad8a74..637c6ef8e8e 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -3,7 +3,7 @@ // Local js definitions: /* global addClass, getCurrentValue, hasClass */ -/* global isHidden onEach, removeClass, updateLocalStorage */ +/* global isHidden, onEach, removeClass, updateLocalStorage */ if (!String.prototype.startsWith) { String.prototype.startsWith = function(searchString, position) { |
