File tree 3 files changed +11
-1
lines changed
src/librustdoc/html/static/js
3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ let ParserState;
37
37
* args: Array<QueryElement>,
38
38
* returned: Array<QueryElement>,
39
39
* foundElems: number,
40
+ * totalElems: number,
40
41
* literalSearch: boolean,
41
42
* corrections: Array<{from: string, to: integer}>,
42
43
* }}
Original file line number Diff line number Diff line change @@ -973,6 +973,8 @@ function initSearch(rawSearchIndex) {
973
973
returned : [ ] ,
974
974
// Total number of "top" elements (does not include generics).
975
975
foundElems : 0 ,
976
+ // Total number of elements (includes generics).
977
+ totalElems : 0 ,
976
978
literalSearch : false ,
977
979
error : null ,
978
980
correction : null ,
@@ -1074,6 +1076,7 @@ function initSearch(rawSearchIndex) {
1074
1076
query . literalSearch = parserState . totalElems > 1 ;
1075
1077
}
1076
1078
query . foundElems = query . elems . length + query . returned . length ;
1079
+ query . totalElems = parserState . totalElems ;
1077
1080
return query ;
1078
1081
}
1079
1082
@@ -1980,7 +1983,7 @@ function initSearch(rawSearchIndex) {
1980
1983
}
1981
1984
elem . id = match ;
1982
1985
}
1983
- if ( ( elem . id === null && parsedQuery . foundElems > 1 && elem . typeFilter === - 1 )
1986
+ if ( ( elem . id === null && parsedQuery . totalElems > 1 && elem . typeFilter === - 1 )
1984
1987
|| elem . typeFilter === TY_GENERIC ) {
1985
1988
if ( genericSymbols . has ( elem . name ) ) {
1986
1989
elem . id = genericSymbols . get ( elem . name ) ;
Original file line number Diff line number Diff line change @@ -72,4 +72,10 @@ const EXPECTED = [
72
72
{ 'path' : 'std::option::Option' , 'name' : 'flatten' } ,
73
73
] ,
74
74
} ,
75
+ {
76
+ 'query' : 'option<t>' ,
77
+ 'returned' : [
78
+ { 'path' : 'std::result::Result' , 'name' : 'ok' } ,
79
+ ] ,
80
+ } ,
75
81
] ;
You can’t perform that action at this time.
0 commit comments