rust/src/doc/rustdoc
Matthias Krüger e3a1e19296
Rollup merge of #93497 - willcrichton:rustdoc-scrape-test, r=GuillaumeGomez
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`
2022-02-18 23:23:05 +01:00
..
src Rollup merge of #93497 - willcrichton:rustdoc-scrape-test, r=GuillaumeGomez 2022-02-18 23:23:05 +01:00
.gitignore add a new mdbook for rustdoc 2017-05-31 12:46:17 -04:00
book.toml rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
README.md Stabilize extended_key_value_attributes 2021-05-18 01:01:36 -04:00

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.