Change:
e.innerHTML = labelForToggleButton(true); }); toggle.title = "expand all docs"; <del> onEach(document.getElementsByClassName("docblock"), function(e) { e.style.display = 'none'; }); onEach(document.getElementsByClassName("toggle-label"), function(e) { e.style.display = 'inline-block'; }); onEach(document.getElementsByClassName("toggle-wrapper"), function(e) { addClass(e, "collapsed"); }); </del> onEach(document.getElementsByClassName("collapse-toggle"), function(e) { <del> onEveryMatchingChild(e, "inner", function(i_e) { i_e.innerHTML = labelForToggleButton(true); }); </del> <ins> collapseDocs(e, "hide"); </ins> }); } } <del> function collapseDocs(toggle) { </del> <ins> function collapseDocs(toggle, mode) { </ins> if (!toggle || !toggle.parentNode) { return; } <del> var relatedDoc = toggle.parentNode.nextElementSibling; if (hasClass(relatedDoc, "stability")) { relatedDoc = relatedDoc.nextElementSibling; } if (hasClass(relatedDoc, "docblock")) { if (!isHidden(relatedDoc)) { relatedDoc.style.display = 'none'; onEach(toggle.childNodes, function(e) { if (hasClass(e, 'toggle-label')) { </del> <ins> function adjustToggle(arg) { return function(e) { if (hasClass(e, 'toggle-label')) { if (arg) { </ins> e.style.display = 'inline-block'; <ins> } else { e.style.display = 'none'; </ins> } <del> if (hasClass(e, 'inner')) { e.innerHTML = labelForToggleButton(true); </del> <ins> } if (hasClass(e, 'inner')) { e.innerHTML = labelForToggleButton(arg); } }; }; if (!hasClass(toggle.parentNode, "impl")) { var relatedDoc = toggle.parentNode.nextElementSibling; if (hasClass(relatedDoc, "stability")) { relatedDoc = relatedDoc.nextElementSibling; } if (hasClass(relatedDoc, "docblock")) { var action = mode; if (action === "toggle") { if (hasClass(relatedDoc, "hidden-by-usual-hider")) { action = "show"; } else { action = "hide"; </ins> } <del> }); addClass(toggle.parentNode, 'collapsed'); } else { relatedDoc.style.display = 'block'; removeClass(toggle.parentNode, 'collapsed'); onEach(toggle.childNodes, function(e) { if (hasClass(e, 'toggle-label')) { e.style.display = 'none'; </del> <ins> } if (action === "hide") { addClass(relatedDoc, "hidden-by-usual-hider"); onEach(toggle.childNodes, adjustToggle(true)); addClass(toggle.parentNode, 'collapsed'); } else if (action === "show") { removeClass(relatedDoc, "hidden-by-usual-hider"); removeClass(toggle.parentNode, 'collapsed'); onEach(toggle.childNodes, adjustToggle(false)); } } } else { // we are collapsing the impl block function implHider(addOrRemove) { return function(n) { if (hasClass(n, "method")) { if (addOrRemove) { addClass(n, "hidden-by-impl-hider"); } else { removeClass(n, "hidden-by-impl-hider"); } var ns = n.nextElementSibling; while (true) { if (ns && ( hasClass(ns, "docblock") || hasClass(ns, "stability") || false )) { if (addOrRemove) { addClass(ns, "hidden-by-impl-hider"); } else { removeClass(ns, "hidden-by-impl-hider"); } ns = ns.nextElementSibling; continue; } break; } </ins> } <del> if (hasClass(e, 'inner')) { e.innerHTML = labelForToggleButton(false); </del> <ins> } } var relatedDoc = toggle.parentNode; while (!hasClass(relatedDoc, "impl-items")) { relatedDoc = relatedDoc.nextElementSibling; } if (!relatedDoc) { return; } // Hide all functions, but not associated types/consts var action = mode; if (action === "toggle") { if (hasClass(relatedDoc, "fns-now-collapsed")) { action = "show"; } else { action = "hide"; } } if (action === "show") { removeClass(relatedDoc, "fns-now-collapsed"); onEach(toggle.childNodes, adjustToggle(false)); onEach(relatedDoc.childNodes, implHider(false)); } else if (action === "hide") { addClass(relatedDoc, "fns-now-collapsed"); onEach(toggle.childNodes, adjustToggle(true)); onEach(relatedDoc.childNodes, implHider(true)); } } } function autoCollapseAllImpls() { // Automatically minimize all non-inherent impls onEach(document.getElementsByClassName('impl'), function(n) { // inherent impl ids are like 'impl' or impl-<number>' var inherent = (n.id.match(/^impl(?:-d+)?$/) !== null); if (!inherent) { onEach(n.childNodes, function(m) { if (hasClass(m, "collapse-toggle")) { collapseDocs(m, "hide"); </ins> } }); } <del> } </del> <ins> }); </ins> } var x = document.getElementById('toggle-all-docs');

Discussion:
When pressing the hotkey on type's documentation such as on the , the methods of the are still shown. This is however mostly useless information that gets in the way of scrolling to see what traits a type implements. It would be more ergonomic if would hide every method of every trait but still show all associated items (types and consts) for each (since they carry useful information). In addition, a / link should be on all the s (including non-trait impls) either besides or to the left of the (as done with s this expands and collapses the impls but keeps associated items shown.
I can rewrite this as an RFC if required, but I was unsure about the protocol wrt. rustdoc.
Similar request:
Closing as resolved.

For example, looking at the docs for , some important trait implementations are hard to find in between all the implementations for each size of fixed-size arrays: Hopefully these impls will eventually become generic, but in the meantime we should consider some way of hiding or collapsing them in the docs.
cc
Dupe of