diff --git a/CHANGELOG.md b/CHANGELOG.md index 37304fb3..0d7a9d1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com ## [Unreleased] +- [Fix mapping error in `--doctests`.](https://github.com/taiki-e/cargo-llvm-cov/pull/40) + ## [0.1.0-alpha.4] - 2021-06-13 - [cargo-llvm-cov no longer requires rustfilt.](https://github.com/taiki-e/cargo-llvm-cov/pull/29) diff --git a/src/main.rs b/src/main.rs index e894bf85..4a784031 100644 --- a/src/main.rs +++ b/src/main.rs @@ -102,6 +102,11 @@ fn main() -> Result<()> { } cargo.args(&["test", "--target-dir"]).arg(&cx.target_dir); + if cx.doctests && !cx.unstable_flags.iter().any(|f| f == "doctest-in-workspace") { + // https://github.com/rust-lang/cargo/issues/9427 + cargo.arg("-Z"); + cargo.arg("doctest-in-workspace"); + } append_args(cx, &mut cargo); cargo.stdout_to_stderr().run()?;