about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2020-01-28 13:48:08 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2020-01-28 23:32:29 +0100
commit0754461e02249aaa0f7f6e8d4ececf5fed00deec (patch)
treef89a8701bb75976063653955f2720837c63a7a97 /src
parent320ada6479b3e29c7d9a66bc56ac44c2d2b57566 (diff)
downloadrust-0754461e02249aaa0f7f6e8d4ececf5fed00deec.tar.gz
rust-0754461e02249aaa0f7f6e8d4ececf5fed00deec.zip
Fix null synthetic_implementors error
Diffstat (limited to 'src')
-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;