Skip to content

Commit 4b5f104

Browse files
committed
added documentation for the -Zdoctest-xcompile feature
1 parent 3596cb8 commit 4b5f104

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/bin/cargo/cli.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Available unstable (nightly-only) flags:
3737
-Z install-upgrade -- `cargo install` will upgrade instead of failing
3838
-Z cache-messages -- Cache compiler messages
3939
-Z timings -- Display concurrency information
40+
-Z doctest-xcompile -- Compile and run doctests for non-host target using runner config
4041
4142
Run with 'cargo -Z [FLAG] [SUBCOMMAND]'"
4243
);

src/doc/src/reference/unstable.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,21 @@ directory. Example:
5858
cargo +nightly build --out-dir=out -Z unstable-options
5959
```
6060

61+
### doctest-xcompile
62+
* Tracking Issue: [#7040](https://github.com/rust-lang/cargo/issues/7040)
63+
* Tracking Rustc Issue: [#64245](https://github.com/rust-lang/rust/issues/64245)
64+
65+
This flag changes `cargo test`'s behavior when handling doctests when
66+
a target is passed. Currently, if a target is passed that is different
67+
from the host cargo will simply skip testing doctests. If this flag is
68+
present, cargo will continue as normal, passing the tests to doctest,
69+
while also passing it a `--target` option, as well as enabling
70+
`-Zunstable-features --enable-per-target-ignores` and passing along
71+
information from `.cargo/config`. See the rustc issue for more information.
72+
73+
```
74+
cargo test --target foo -Zdoctest-xcompile
75+
```
6176

6277
### Profile Overrides
6378
* Tracking Issue: [rust-lang/rust#48683](https://github.com/rust-lang/rust/issues/48683)

0 commit comments

Comments
 (0)