rustdoc-search: fix fast path unboxing bindings

This commit is contained in:
Michael Howell 2023-12-10 20:53:53 -07:00
parent 92b84f849a
commit 7162cb9550
2 changed files with 12 additions and 1 deletions

View File

@ -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,

View File

@ -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',