File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 14
14
search-index.py checks the contents of search-indexes generated by rustdoc
15
15
against a reference, which is being used by compiletest during rustdoc tests.
16
16
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 :
19
19
```
20
+ // check-search-index
21
+
20
22
pub struct foo {
21
23
field: i32,
22
24
}
32
34
*/
33
35
```
34
36
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
+
35
45
The reference-index, a simplified json-format of the search-index, is structured like this:
36
46
```
37
47
{
You can’t perform that action at this time.
0 commit comments