about summary refs log tree commit diff
path: root/src/librustdoc/html
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-12-15 15:58:46 +0000
committerbors <bors@rust-lang.org>2020-12-15 15:58:46 +0000
commite15ec667cee92d47c64fc903227b2fdb81f9e530 (patch)
treebdd5b0d1175f30fc6c186650087ccd64428bf4ce /src/librustdoc/html
parent99baddb57c0a950c1af8d125dc470894ddf052a7 (diff)
parent0dcf99b2a260652cac9f04fe2957629e0c8e0464 (diff)
downloadrust-e15ec667cee92d47c64fc903227b2fdb81f9e530.tar.gz
rust-e15ec667cee92d47c64fc903227b2fdb81f9e530.zip
Auto merge of #80055 - GuillaumeGomez:rollup-p09mweg, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - #79379 (Show hidden elements by default when JS is disabled)
 - #79796 (Hide associated constants too when collapsing implementation)
 - #79958 (Fixes reported bugs in Rust Coverage)
 - #80008 (Fix `cargo-binutils` link)
 - #80016 (Use imports instead of rewriting the type signature of `RustcOptGroup::stable`)
 - #80025 (Replace some `println!` with `tidy_error!` to simplify)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/librustdoc/html')
-rw-r--r--src/librustdoc/html/static/main.js9
-rw-r--r--src/librustdoc/html/static/noscript.css10
2 files changed, 16 insertions, 3 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 47847ccb5f6..1de4b0016c5 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -2274,9 +2274,12 @@ function defocusSearchBar() {
 
         function implHider(addOrRemove, fullHide) {
             return function(n) {
-                var is_method = hasClass(n, "method") || fullHide;
-                if (is_method || hasClass(n, "type")) {
-                    if (is_method === true) {
+                var shouldHide =
+                    fullHide === true ||
+                    hasClass(n, "method") === true ||
+                    hasClass(n, "associatedconstant") === true;
+                if (shouldHide === true || hasClass(n, "type") === true) {
+                    if (shouldHide === true) {
                         if (addOrRemove) {
                             addClass(n, "hidden-by-impl-hider");
                         } else {
diff --git a/src/librustdoc/html/static/noscript.css b/src/librustdoc/html/static/noscript.css
index 832bd9ba2d6..ffa1a7639ab 100644
--- a/src/librustdoc/html/static/noscript.css
+++ b/src/librustdoc/html/static/noscript.css
@@ -1,3 +1,9 @@
+/*
+This whole CSS file is used only in case rustdoc is rendered with javascript disabled. Since a lot
+of content is hidden by default (depending on the settings too), we have to overwrite some of the
+rules.
+*/
+
 #main > h2 + div, #main > h2 + h3, #main > h3 + div {
 	display: block;
 }
@@ -13,3 +19,7 @@
 #main > h2 + h3 {
 	display: flex;
 }
+
+#main .impl-items .hidden {
+	display: block !important;
+}