Skip to content

Commit 70a839f

Browse files
Rollup merge of #79300 - GuillaumeGomez:hidden-feature-info, r=jyn514
Prevent feature information to be hidden if it's on the impl directly Fixes #79279. So when a `#[doc(cfg...)]` is used on a trait impl directly, it's not hidden by the toggle. ![Screenshot from 2020-11-22 14-40-11](https://user-images.githubusercontent.com/3050060/99905528-997fab00-2cd1-11eb-83be-ed06b0cb97df.png) r? `@jyn514`
2 parents 5c982b7 + 28a94a3 commit 70a839f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/librustdoc/html/static/main.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -2332,12 +2332,18 @@ function defocusSearchBar() {
23322332
var dontApplyBlockRule = toggle.parentNode.parentNode.id !== "main";
23332333
if (action === "show") {
23342334
removeClass(relatedDoc, "fns-now-collapsed");
2335-
removeClass(docblock, "hidden-by-usual-hider");
2335+
// Stability information is never hidden.
2336+
if (hasClass(docblock, "stability") === false) {
2337+
removeClass(docblock, "hidden-by-usual-hider");
2338+
}
23362339
onEachLazy(toggle.childNodes, adjustToggle(false, dontApplyBlockRule));
23372340
onEachLazy(relatedDoc.childNodes, implHider(false, dontApplyBlockRule));
23382341
} else if (action === "hide") {
23392342
addClass(relatedDoc, "fns-now-collapsed");
2340-
addClass(docblock, "hidden-by-usual-hider");
2343+
// Stability information should be shown even when detailed info is hidden.
2344+
if (hasClass(docblock, "stability") === false) {
2345+
addClass(docblock, "hidden-by-usual-hider");
2346+
}
23412347
onEachLazy(toggle.childNodes, adjustToggle(true, dontApplyBlockRule));
23422348
onEachLazy(relatedDoc.childNodes, implHider(true, dontApplyBlockRule));
23432349
}

0 commit comments

Comments
 (0)