diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 9e00a64d3f5..56cea50a502 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -828,6 +828,9 @@
$(document).on("click", ".collapse-toggle", function() {
var toggle = $(this);
var relatedDoc = toggle.parent().next();
+ if (relatedDoc.is(".stability")) {
+ relatedDoc = relatedDoc.next();
+ }
if (relatedDoc.is(".docblock")) {
if (relatedDoc.is(":visible")) {
relatedDoc.slideUp({duration:'fast', easing:'linear'});
@@ -848,9 +851,10 @@
.html("[-]");
$(".method").each(function() {
- if ($(this).next().is(".docblock")) {
- $(this).children().first().after(toggle.clone());
- }
+ if ($(this).next().is(".docblock") ||
+ ($(this).next().is(".stability") && $(this).next().next().is(".docblock"))) {
+ $(this).children().first().after(toggle.clone());
+ }
});
var mainToggle =