Skip to content

Commit f458d8f

Browse files
authored
Rollup merge of #86746 - GuillaumeGomez:query-type-filter, r=notriddle
Fix rustdoc query type filter I realized while reviewing #86659 that the type filter was broken on search so I'd prefer it to get merged before merging #86659. r? `@notriddle`
2 parents e52a0ec + 855923c commit f458d8f

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/librustdoc/html/static/search.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,8 @@ window.initSearch = function(rawSearchIndex) {
801801
results_returned[fullId].lev =
802802
Math.min(results_returned[fullId].lev, returned);
803803
}
804-
if (index !== -1 || lev <= MAX_LEV_DISTANCE) {
804+
if (typePassesFilter(typeFilter, ty.ty) &&
805+
(index !== -1 || lev <= MAX_LEV_DISTANCE)) {
805806
if (index !== -1 && paths.length < 2) {
806807
lev = 0;
807808
}
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// exact-check
2+
3+
const QUERY = 'macro:print';
4+
5+
const EXPECTED = {
6+
'others': [
7+
{ 'path': 'std', 'name': 'print' },
8+
{ 'path': 'std', 'name': 'eprint' },
9+
{ 'path': 'std', 'name': 'println' },
10+
{ 'path': 'std', 'name': 'eprintln' },
11+
],
12+
};

0 commit comments

Comments
 (0)