Skip to content

Commit 956a76b

Browse files
committed
Update search-index.py documentation
1 parent eaf77ee commit 956a76b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/etc/search-index.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
search-index.py checks the contents of search-indexes generated by rustdoc
1515
against a reference, which is being used by compiletest during rustdoc tests.
1616
17-
The reference to check against is embedded into the rustdoc tests source-file,
18-
fenced by a block comment `/* !search index {} */` so that it can be extracted:
17+
To add this check to a rustdoc test a `// check-search-index` compiletest directive and
18+
a reference-index, fencend in `/* !search-index ... */`, needs to be inserted:
1919
```
20+
// check-search-index
21+
2022
pub struct foo {
2123
field: i32,
2224
}
@@ -32,6 +34,14 @@
3234
*/
3335
```
3436
37+
The reference-index can be written by hand or dumped from an existing search-index,
38+
requiring the rustdoc test to be built by rustdoc beforehand, through:
39+
`python search-index.py dump .../search-index.js`
40+
41+
which can then be copied directly into the rustdoc test.
42+
43+
44+
3545
The reference-index, a simplified json-format of the search-index, is structured like this:
3646
```
3747
{

0 commit comments

Comments
 (0)