From 7162cb95500a066da51bc8ba7929809ec02bc835 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sun, 10 Dec 2023 20:53:53 -0700 Subject: [PATCH] rustdoc-search: fix fast path unboxing bindings --- src/librustdoc/html/static/js/search.js | 2 +- tests/rustdoc-js/assoc-type.js | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) 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 -> u32',