Pass `--test` flag through rustdoc to rustc so `#[test]` functions can be scraped As a part of stabilizing the scrape examples extension in Cargo, I uncovered a bug where examples cannot be scraped from tests. See this test: https://github.com/rust-lang/cargo/pull/10343/files#diff-27aa4f012ebfebaaee61498d91d2370de460628405d136b05e77efe61e044679R2496 The issue is that when rustdoc is run on a test file, because `--test` is not passed as a rustc option, then functions annotated with `#[test]` are ignored by the compiler. So this PR changes rustdoc so when `--test` is passed in conjunction with a `--scrape-example-<suffix>` flag, then the `test` field of `rustc_interface::Config` is true. r? `@camelid` |
||
|---|---|---|
| .. | ||
| src | ||
| .gitignore | ||
| book.toml | ||
| README.md | ||
Rustdoc
This is documentation for rustdoc itself, written in mdbook format.
To build the book, use x.py doc src/doc/rustdoc.
To run doctests, use x.py test src/doc/rustdoc.