Skip to content

Commit f1c5ebe

Browse files
authored
Rollup merge of #148176 - GuillaumeGomez:filter-macros, r=notriddle
[rustdoc] Include attribute and derive macros when filtering on "macros" As discussed [here](#147909), some filters should have been "grouped". This PR allows attribute and derive macros to match the `macro` filter. I'll wait for #148005 to add more tests as it would require a proc-macro library for now. r? `@notriddle`
2 parents d437c42 + 52c99e6 commit f1c5ebe

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3904,6 +3904,8 @@ class DocSearch {
39043904
return name === "primitive" || name === "associatedtype";
39053905
case "trait":
39063906
return name === "traitalias";
3907+
case "macro":
3908+
return name === "attr" || name === "derive";
39073909
}
39083910

39093911
// No match
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This test ensures that filtering on "macro" will also include attribute and derive
2+
// macros.
3+
4+
const EXPECTED = {
5+
'query': 'macro:debug',
6+
'others': [
7+
{ 'path': 'std::fmt', 'name': 'Debug', 'href': '../std/fmt/derive.Debug.html' },
8+
],
9+
};

0 commit comments

Comments
 (0)