From ca93cb9f063f84d27c363af85c744694390bf204 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Wed, 11 Aug 2021 03:32:42 +0900 Subject: [PATCH] Support trybuild (take 2) --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.rs b/src/main.rs index dda7e122..6d34c0db 100644 --- a/src/main.rs +++ b/src/main.rs @@ -91,6 +91,9 @@ fn run_test(cx: &Context) -> Result<()> { " -Z instrument-coverage --remap-path-prefix {}/=", cx.metadata.workspace_root )); + if cx.target.is_none() { + rustflags.push(" --cfg trybuild_no_target"); + } // https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/instrument-coverage.html#including-doc-tests let rustdocflags = &mut cx.env.rustdocflags.clone();