Rollup merge of #148176 - GuillaumeGomez:filter-macros, r=notriddle
[rustdoc] Include attribute and derive macros when filtering on "macros" As discussed [here](https://github.com/rust-lang/rust/pull/147909), some filters should have been "grouped". This PR allows attribute and derive macros to match the `macro` filter. I'll wait for https://github.com/rust-lang/rust/pull/148005 to add more tests as it would require a proc-macro library for now. r? ```@notriddle```
This commit is contained in:
@@ -3904,6 +3904,8 @@ class DocSearch {
|
||||
return name === "primitive" || name === "associatedtype";
|
||||
case "trait":
|
||||
return name === "traitalias";
|
||||
case "macro":
|
||||
return name === "attr" || name === "derive";
|
||||
}
|
||||
|
||||
// No match
|
||||
|
||||
9
tests/rustdoc-js-std/filter-macro-attr-derive.js
Normal file
9
tests/rustdoc-js-std/filter-macro-attr-derive.js
Normal file
@@ -0,0 +1,9 @@
|
||||
// This test ensures that filtering on "macro" will also include attribute and derive
|
||||
// macros.
|
||||
|
||||
const EXPECTED = {
|
||||
'query': 'macro:debug',
|
||||
'others': [
|
||||
{ 'path': 'std::fmt', 'name': 'Debug', 'href': '../std/fmt/derive.Debug.html' },
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user