This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
src/librustdoc/html/static/js Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ let ParserState;
3737 * args: Array<QueryElement>,
3838 * returned: Array<QueryElement>,
3939 * foundElems: number,
40+ * totalElems: number,
4041 * literalSearch: boolean,
4142 * corrections: Array<{from: string, to: integer}>,
4243 * }}
Original file line number Diff line number Diff line change @@ -973,6 +973,8 @@ function initSearch(rawSearchIndex) {
973973 returned : [ ] ,
974974 // Total number of "top" elements (does not include generics).
975975 foundElems : 0 ,
976+ // Total number of elements (includes generics).
977+ totalElems : 0 ,
976978 literalSearch : false ,
977979 error : null ,
978980 correction : null ,
@@ -1074,6 +1076,7 @@ function initSearch(rawSearchIndex) {
10741076 query . literalSearch = parserState . totalElems > 1 ;
10751077 }
10761078 query . foundElems = query . elems . length + query . returned . length ;
1079+ query . totalElems = parserState . totalElems ;
10771080 return query ;
10781081 }
10791082
@@ -1980,7 +1983,7 @@ function initSearch(rawSearchIndex) {
19801983 }
19811984 elem . id = match ;
19821985 }
1983- if ( ( elem . id === null && parsedQuery . foundElems > 1 && elem . typeFilter === - 1 )
1986+ if ( ( elem . id === null && parsedQuery . totalElems > 1 && elem . typeFilter === - 1 )
19841987 || elem . typeFilter === TY_GENERIC ) {
19851988 if ( genericSymbols . has ( elem . name ) ) {
19861989 elem . id = genericSymbols . get ( elem . name ) ;
Original file line number Diff line number Diff line change @@ -72,4 +72,10 @@ const EXPECTED = [
7272 { 'path' : 'std::option::Option' , 'name' : 'flatten' } ,
7373 ] ,
7474 } ,
75+ {
76+ 'query' : 'option<t>' ,
77+ 'returned' : [
78+ { 'path' : 'std::result::Result' , 'name' : 'ok' } ,
79+ ] ,
80+ } ,
7581] ;
You can’t perform that action at this time.
0 commit comments