Skip to content

Commit 1b3e261

Browse files
committed
support passing -C instrument-coverage in RUSTFLAGS
1 parent c0286aa commit 1b3e261

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/rustflags.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,14 @@ pub(crate) fn toml() -> toml::Value {
88
rustflags.push(lint);
99
}
1010

11+
if let Some(flags) = std::env::var("RUSTFLAGS").ok() {
12+
// TODO: could parse this properly and allowlist (or blocklist?)
13+
// certain flags. This is good enough to at least support
14+
// `cargo-llvm-cov`.
15+
if flags.contains("-C instrument-coverage") {
16+
rustflags.extend(["-C", "instrument-coverage"]);
17+
}
18+
}
19+
1120
toml::Value::try_from(rustflags).unwrap()
1221
}

0 commit comments

Comments
 (0)