Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--target $host causes doctests to be silently ignored #8392

Closed
alecmocatta opened this issue Jun 21, 2020 · 2 comments
Closed

--target $host causes doctests to be silently ignored #8392

alecmocatta opened this issue Jun 21, 2020 · 2 comments
Labels
C-bug Category: bug

Comments

@alecmocatta
Copy link

Problem

--target causes doctests to be silently ignored even though target == host.

Steps

$ cargo new --lib doctesttest
$ cd doctesttest
$ echo $'/// ```\n/// invalid\n/// ```\npub fn abc() {}' > src/lib.rs
$ cargo test
# runs doctests and fails
$ cargo test --target x86_64-apple-darwin
# doesn't run doctests and succeeds
$ cargo test --target x86_64-apple-darwin -Zdoctest-xcompile
# runs doctests and fails

One other thing I noticed: doctests for proc-macro crates do seem to run.

Possible Solution(s)

Using -Zdoctest-xcompile works as a workaround but of course is unstable.

Notes

Output of cargo version:

$ cargo -V
cargo 1.46.0-nightly (79c769c3d 2020-06-11)
$ rustc -Vv
rustc 1.46.0-nightly (f455e46ea 2020-06-20)
binary: rustc
commit-hash: f455e46eae1a227d735091091144601b467e1565
commit-date: 2020-06-20
host: x86_64-apple-darwin
release: 1.46.0-nightly
LLVM version: 10.0
@ehuss
Copy link
Contributor

ehuss commented Jun 21, 2020

Thanks for the report! This will be fixed as soon as rust-lang/rust#73415 merges.

@alecmocatta
Copy link
Author

Oh I see, thanks! I couldn't see an issue for this (I didn't think to check PRs) so my inclination is to leave it open for anyone else looking? And I'll be sure to close once that PR merges and I've confirmed this is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants