Skip to content

Commit

Permalink
rustdoc-search: fix fast path unboxing bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
notriddle committed Dec 11, 2023
1 parent 92b84f8 commit 7162cb9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 11 additions & 0 deletions tests/rustdoc-js/assoc-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 7162cb9

Please sign in to comment.