about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-06-08 22:15:08 +0200
committerGitHub <noreply@github.com>2020-06-08 22:15:08 +0200
commit98bd22bda33c28027d74e3441ff76c034f0b9180 (patch)
tree365b81e11a31fb219ffabc2ea09e48429ab8ab9f /src
parentbc10b68e798477066d4b1ec4886a3b1cdc4feb7e (diff)
parentda18df285910446d5b4c212b96379e694f47533f (diff)
downloadrust-98bd22bda33c28027d74e3441ff76c034f0b9180.tar.gz
rust-98bd22bda33c28027d74e3441ff76c034f0b9180.zip
Rollup merge of #71842 - tspiteri:doc-impl-const, r=GuillaumeGomez
doc: make impl block collapsible if it has an associated constant

Fixes #71822.
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/static/main.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index ac5a2f96b26..953f61a3772 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -2374,7 +2374,9 @@ function defocusSearchBar() {
             if (!next) {
                 return;
             }
-            if (next.getElementsByClassName("method").length > 0 && hasClass(e, "impl")) {
+            if (hasClass(e, "impl") &&
+                (next.getElementsByClassName("method").length > 0 ||
+                 next.getElementsByClassName("associatedconstant").length > 0)) {
                 insertAfter(toggle.cloneNode(true), e.childNodes[e.childNodes.length - 1]);
             }
         };