Added ability to crosscompile doctests by Goirad · Pull Request #6892 · rust-lang/cargo (original) (raw)
I have modified the companion PR for rustdoc to feature-gate ignore-foo attributes in doctests.
I would like some input on how to handle this in Cargo. As the PR is currently written, there is no new feature in Cargo, and if someone runs cargo test --target foo
without setting a runner in .cargo/config
for foo, the only difference is that a message is displayed warning them that doctests were skipped because no runner was set, instead of the current behavior, which is to completely skip the doctest section.
If on the other hand a runner is defined, then Cargo automatically adds -Z unstable-options
to the rustdoc invokations, since --runtool
is unstable in rustdoc, and passes the runtool and its arguments. It also enables the feature for ignoring doctests on a per target basis, since that seems critical for cross-compiling doctests.
My question is if any of these three things should be behind feature-gates in Cargo, namely cross-compiling doctests at all, passing runtool, and enabling per-target ignores; and if so whether there should be one feature for all of them, or some more granular approach.