about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2023-12-10 20:53:53 -0700
committerMichael Howell <michael@notriddle.com>2023-12-10 20:53:53 -0700
commit7162cb95500a066da51bc8ba7929809ec02bc835 (patch)
tree79c99df27e635c07c2ea448827b062fd7653f0b5
parent92b84f849a63af6454845452ee8a5567d6956302 (diff)
downloadrust-7162cb95500a066da51bc8ba7929809ec02bc835.tar.gz
rust-7162cb95500a066da51bc8ba7929809ec02bc835.zip
rustdoc-search: fix fast path unboxing bindings
-rw-r--r--src/librustdoc/html/static/js/search.js2
-rw-r--r--tests/rustdoc-js/assoc-type.js11
2 files changed, 12 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js
index 832ac427112..a521bf66bed 100644
--- a/src/librustdoc/html/static/js/search.js
+++ b/src/librustdoc/html/static/js/search.js
@@ -1433,7 +1433,7 @@ function initSearch(rawSearchIndex) {
                             return true;
                         }
                     } else if (unifyFunctionTypes(
-                        fnType.generics,
+                        [...fnType.generics, ...Array.from(fnType.bindings.values()).flat() ],
                         queryElems,
                         whereClause,
                         mgens ? new Map(mgens) : null,
diff --git a/tests/rustdoc-js/assoc-type.js b/tests/rustdoc-js/assoc-type.js
index cc3afaa17c0..47776656e32 100644
--- a/tests/rustdoc-js/assoc-type.js
+++ b/tests/rustdoc-js/assoc-type.js
@@ -19,6 +19,17 @@ const EXPECTED = [
             { 'path': 'assoc_type::my', 'name': 'other_fn' },
         ],
     },
+    {
+        'query': 'something',
+        'correction': null,
+        'others': [
+            { 'path': 'assoc_type', 'name': 'Something' },
+        ],
+        'in_args': [
+            { 'path': 'assoc_type', 'name': 'my_fn' },
+            { 'path': 'assoc_type::my', 'name': 'other_fn' },
+        ],
+    },
     // if I write an explicit binding, only it shows up
     {
         'query': 'iterator<item=something> -> u32',