about summary refs log tree commit diff
path: root/src/librustdoc/html/static
diff options
context:
space:
mode:
authorDavid Wood <david@davidtw.co>2019-03-23 02:36:30 +0100
committerDavid Wood <david@davidtw.co>2019-03-29 11:03:35 +0100
commit49a6da2cda1a208838911e296fc72a6791e68406 (patch)
treeddccdb032fd71f600e948b9082cf9734f6f473be /src/librustdoc/html/static
parent18938416e4d34d7f7d64d11decd87ce47036bb75 (diff)
downloadrust-49a6da2cda1a208838911e296fc72a6791e68406.tar.gz
rust-49a6da2cda1a208838911e296fc72a6791e68406.zip
Support non-exhaustive enum variants in rustdoc.
This commit adds support for non-exhaustive enum variants in rustdoc,
extending the existing support for non-exhaustive enums and structs.
Diffstat (limited to 'src/librustdoc/html/static')
-rw-r--r--src/librustdoc/html/static/main.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index fef6910f40a..85dc4d57337 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -2247,6 +2247,8 @@ if (!DOMTokenList.prototype.remove) {
                     otherMessage += "struct";
                 } else if (hasClass(e, "non-exhaustive-enum")) {
                     otherMessage += "enum";
+                } else if (hasClass(e, "non-exhaustive-variant")) {
+                    otherMessage += "enum variant";
                 } else if (hasClass(e, "non-exhaustive-type")) {
                     otherMessage += "type";
                 }
@@ -2264,6 +2266,9 @@ if (!DOMTokenList.prototype.remove) {
             if (hasClass(e, "type-decl") === true && showItemDeclarations === true) {
                 collapseDocs(e.previousSibling.childNodes[0], "toggle");
             }
+            if (hasClass(e, "non-exhaustive") === true) {
+                collapseDocs(e.previousSibling.childNodes[0], "toggle");
+            }
         }
     }