about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-01-29 18:56:28 +0900
committerGitHub <noreply@github.com>2020-01-29 18:56:28 +0900
commited351e2818f906e87ac95cd0019ba39d62401d58 (patch)
treef2550c80c48d6d4d8a287749d73392b66fb9d450
parent8f1857a822e7aa97337e8026896845d89f7adb47 (diff)
parent0754461e02249aaa0f7f6e8d4ececf5fed00deec (diff)
downloadrust-ed351e2818f906e87ac95cd0019ba39d62401d58.tar.gz
rust-ed351e2818f906e87ac95cd0019ba39d62401d58.zip
Rollup merge of #68598 - GuillaumeGomez:fix-null-synthetic_implementors, r=ollie27
Fix null synthetic_implementors error

Fixes #68584.

r? @ollie27

cc @kinnison
-rw-r--r--src/librustdoc/html/static/main.js30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index ec881d25dd2..44fd8b929f3 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -1895,21 +1895,23 @@ function getSearchElement() {
         var implementors = document.getElementById("implementors-list");
         var synthetic_implementors = document.getElementById("synthetic-implementors-list");
 
-        // This `inlined_types` variable is used to avoid having the same implementation showing
-        // up twice. For example "String" in the "Sync" doc page.
-        //
-        // By the way, this is only used by and useful for traits implemented automatically (like
-        // "Send" and "Sync").
-        var inlined_types = new Set();
-        onEachLazy(synthetic_implementors.getElementsByClassName("impl"), function(el) {
-            var aliases = el.getAttribute("aliases");
-            if (!aliases) {
-                return;
-            }
-            aliases.split(",").forEach(function(alias) {
-                inlined_types.add(alias);
+        if (synthetic_implementors) {
+            // This `inlined_types` variable is used to avoid having the same implementation
+            // showing up twice. For example "String" in the "Sync" doc page.
+            //
+            // By the way, this is only used by and useful for traits implemented automatically
+            // (like "Send" and "Sync").
+            var inlined_types = new Set();
+            onEachLazy(synthetic_implementors.getElementsByClassName("impl"), function(el) {
+                var aliases = el.getAttribute("aliases");
+                if (!aliases) {
+                    return;
+                }
+                aliases.split(",").forEach(function(alias) {
+                    inlined_types.add(alias);
+                });
             });
-        });
+        }
 
         var libs = Object.getOwnPropertyNames(imp);
         var llength = libs.length;