Skip to content

Commit 3c19d3d

Browse files
author
Tamas Vajk
committed
Revert "Always instrument test targets for coverage"
This reverts commit d21e160.
1 parent d21e160 commit 3c19d3d

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

rust/private/rustc.bzl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,10 +1223,7 @@ def construct_arguments(
12231223
# Use Bazel's standard instrumentation filter (--instrumentation_filter)
12241224
# so that only targets matching the filter get instrumented, consistent
12251225
# with how coverage works for other languages (Java, C++).
1226-
# Test targets always need instrumentation since the coverage runtime
1227-
# only initializes if the binary is compiled with -Cinstrument-coverage,
1228-
# even when the statically linked library code was instrumented.
1229-
if toolchain.coverage_supported and ctx.configuration.coverage_enabled and (crate_info.is_test or ctx.coverage_instrumented()):
1226+
if toolchain.coverage_supported and ctx.configuration.coverage_enabled and ctx.coverage_instrumented():
12301227
rustc_flags.add("--codegen=instrument-coverage")
12311228

12321229
if toolchain._experimental_link_std_dylib:

0 commit comments

Comments
 (0)