Skip to content

Commit 7162cb9

Browse files
committed
rustdoc-search: fix fast path unboxing bindings
1 parent 92b84f8 commit 7162cb9

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/librustdoc/html/static/js/search.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,7 @@ function initSearch(rawSearchIndex) {
14331433
return true;
14341434
}
14351435
} else if (unifyFunctionTypes(
1436-
fnType.generics,
1436+
[...fnType.generics, ...Array.from(fnType.bindings.values()).flat() ],
14371437
queryElems,
14381438
whereClause,
14391439
mgens ? new Map(mgens) : null,

tests/rustdoc-js/assoc-type.js

+11
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ const EXPECTED = [
1919
{ 'path': 'assoc_type::my', 'name': 'other_fn' },
2020
],
2121
},
22+
{
23+
'query': 'something',
24+
'correction': null,
25+
'others': [
26+
{ 'path': 'assoc_type', 'name': 'Something' },
27+
],
28+
'in_args': [
29+
{ 'path': 'assoc_type', 'name': 'my_fn' },
30+
{ 'path': 'assoc_type::my', 'name': 'other_fn' },
31+
],
32+
},
2233
// if I write an explicit binding, only it shows up
2334
{
2435
'query': 'iterator<item=something> -> u32',

0 commit comments

Comments
 (0)