about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-02-18 23:23:05 +0100
committerGitHub <noreply@github.com>2022-02-18 23:23:05 +0100
commite3a1e192960c41acc196b59f0cb1b28f78e712f8 (patch)
tree86a2d2d437d5a4939771c463b0275b0c7f552a82 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parent5c08c391211ca4d67e1908fccad45d73c6c76124 (diff)
parentfbbcb089c52e6dce88600be36a1cc97884294d4f (diff)
downloadrust-e3a1e192960c41acc196b59f0cb1b28f78e712f8.tar.gz
rust-e3a1e192960c41acc196b59f0cb1b28f78e712f8.zip
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`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions