You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generated output (formatted) will look like this:
570
+
571
+
```json
572
+
{
573
+
"format_version": 1,
574
+
"doctests": [
575
+
{
576
+
"file": "foo.rs",
577
+
"line": 1,
578
+
"doctest_attributes": {
579
+
"original": "",
580
+
"should_panic": false,
581
+
"no_run": false,
582
+
"ignore": "None",
583
+
"rust": true,
584
+
"test_harness": false,
585
+
"compile_fail": false,
586
+
"standalone_crate": false,
587
+
"error_codes": [],
588
+
"edition": null,
589
+
"added_css_classes": [],
590
+
"unknown": []
591
+
},
592
+
"original_code": "let x = 12;",
593
+
"doctest_code": "#![allow(unused)]\nfn main() {\nlet x = 12;\n}",
594
+
"name": "foo.rs - Trait (line 1)"
595
+
}
596
+
]
597
+
}
598
+
```
599
+
600
+
*`format_version` gives you the current version of the generated JSON. If we change the output in any way, the number will increase.
601
+
*`doctests` contains the list of doctests present in the crate.
602
+
*`file` is the file path where the doctest is located.
603
+
*`line` is the line where the doctest starts (so where the \`\`\` is located in the current code).
604
+
*`doctest_attributes` contains computed information about the attributes used on the doctests. For more information about doctest attributes, take a look [here](write-documentation/documentation-tests.html#attributes).
605
+
*`original_code` is the code as written in the source code before rustdoc modifies it.
606
+
*`doctest_code` is the code modified by rustdoc that will be run. If there is a fatal syntax error, this field will not be present.
607
+
*`name` is the name generated by rustdoc which represents this doctest.
608
+
545
609
## `--enable-per-target-ignores`: allow `ignore-foo` style filters for doctests
0 commit comments