Tracking issue for cross-compiling doc tests (doctest-xcompile) · Issue #7040 · rust-lang/cargo (original) (raw)

Implementation: #6892
Rustc tracking issue: rust-lang/rust#64245
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#doctest-xcompile
Issues: Z-doctest-xcompile Nightly: doctest-xcompile

This PR adds the unstable -Zdoctest-xcompile flag to cargo. When present, instead of skipping doctests when host != target as it does now, cargo parses the runner field for target from .cargo/config and passes that to rustdoc. See here for the companion PR in rust that adds the necessary functionality to rustdoc. The flag also enables a new unstable --enable-per-target-ignores flag in rustdoc, allowing the use of compiletest-style --ignore-foo annotations for doctests so that they are ignored on a per-target basis. The motivation for these PRs, along with another modifying compiltest and bootstrap (not yet submitted), is to allow bootstrap to utilize the many doctests found in the various crates in the rust compiler, notably libstd and libcore.

This should add uniformity and expand testsuites for projects that build for other platforms, since the runner field is already used by cargo test.

Unresolved issues