From 4b5f104f4f4df0925eb6b494c86da2c26d666398 Mon Sep 17 00:00:00 2001 From: Dario Gonzalez Date: Fri, 20 Sep 2019 11:03:32 -0700 Subject: [PATCH] added documentation for the -Zdoctest-xcompile feature --- src/bin/cargo/cli.rs | 1 + src/doc/src/reference/unstable.md | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/bin/cargo/cli.rs b/src/bin/cargo/cli.rs index 87486b8b6c4..1242c64dd3c 100644 --- a/src/bin/cargo/cli.rs +++ b/src/bin/cargo/cli.rs @@ -37,6 +37,7 @@ Available unstable (nightly-only) flags: -Z install-upgrade -- `cargo install` will upgrade instead of failing -Z cache-messages -- Cache compiler messages -Z timings -- Display concurrency information + -Z doctest-xcompile -- Compile and run doctests for non-host target using runner config Run with 'cargo -Z [FLAG] [SUBCOMMAND]'" ); diff --git a/src/doc/src/reference/unstable.md b/src/doc/src/reference/unstable.md index 60a54be7c0d..08b34df285c 100644 --- a/src/doc/src/reference/unstable.md +++ b/src/doc/src/reference/unstable.md @@ -58,6 +58,21 @@ directory. Example: cargo +nightly build --out-dir=out -Z unstable-options ``` +### doctest-xcompile +* Tracking Issue: [#7040](https://github.com/rust-lang/cargo/issues/7040) +* Tracking Rustc Issue: [#64245](https://github.com/rust-lang/rust/issues/64245) + +This flag changes `cargo test`'s behavior when handling doctests when +a target is passed. Currently, if a target is passed that is different +from the host cargo will simply skip testing doctests. If this flag is +present, cargo will continue as normal, passing the tests to doctest, +while also passing it a `--target` option, as well as enabling +`-Zunstable-features --enable-per-target-ignores` and passing along +information from `.cargo/config`. See the rustc issue for more information. + +``` +cargo test --target foo -Zdoctest-xcompile +``` ### Profile Overrides * Tracking Issue: [rust-lang/rust#48683](https://github.com/rust-lang/rust/issues/48683)