diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2020-11-16 17:26:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-16 17:26:25 +0100 |
| commit | 7a1bd805fa50d1fd3f7a4459038819b748424ab9 (patch) | |
| tree | 269ab42e5f0b4ae66def66232889bc0d85cb5b03 /src/librustdoc/html/static | |
| parent | c75f21008de0679d15ee412043dacd14cee0cdb4 (diff) | |
| parent | c34350ab4f8a9480dc5fa89d637e61ab7acd5280 (diff) | |
| download | rust-7a1bd805fa50d1fd3f7a4459038819b748424ab9.tar.gz rust-7a1bd805fa50d1fd3f7a4459038819b748424ab9.zip | |
Rollup merge of #78678 - Nemo157:doc-cfg-w-traits, r=jyn514,GuillaumeGomez
Add tests and improve rendering of cfgs on traits Shows the additional features required to get the trait implementation, suppressing any already shown on the current page. One interesting effect from this is if you have a cfg-ed type, implementing a cfg-ed trait (so the implementation depends on both cfgs), you will get the inverted pair of cfgs shown on each page:   The hidden items on the trait implementation also now get the correct cfgs displayed on them. Tests are blocked on #78673. fixes #68100 cc #43781
Diffstat (limited to 'src/librustdoc/html/static')
| -rw-r--r-- | src/librustdoc/html/static/main.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index cbf15cd0b6e..b8377dc1569 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -2439,12 +2439,13 @@ function defocusSearchBar() { var func = function(e) { var next = e.nextElementSibling; + if (next && hasClass(next, "stability")) { + next = next.nextElementSibling; + } if (!next) { return; } - if (hasClass(next, "docblock") === true || - (hasClass(next, "stability") === true && - hasClass(next.nextElementSibling, "docblock") === true)) { + if (hasClass(next, "docblock")) { var newToggle = toggle.cloneNode(true); insertAfter(newToggle, e.childNodes[e.childNodes.length - 1]); if (hideMethodDocs === true && hasClass(e, "method") === true) { @@ -2455,6 +2456,9 @@ function defocusSearchBar() { var funcImpl = function(e) { var next = e.nextElementSibling; + if (next && hasClass(next, "stability")) { + next = next.nextElementSibling; + } if (next && hasClass(next, "docblock")) { next = next.nextElementSibling; } |
