Skip to content

Commit 605165b

Browse files
committed
Remove support for alias -Z instrument-coverage
This flag was stabilized in rustc 1.60.0 as `-C instrument-coverage`, but the old unstable flag was kept around as an alias to ease migration.
1 parent f654229 commit 605165b

File tree

3 files changed

+11
-29
lines changed

3 files changed

+11
-29
lines changed

compiler/rustc_interface/src/tests.rs

-1
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,6 @@ fn test_unstable_options_tracking_hash() {
789789
tracked!(inline_mir, Some(true));
790790
tracked!(inline_mir_hint_threshold, Some(123));
791791
tracked!(inline_mir_threshold, Some(123));
792-
tracked!(instrument_coverage, Some(InstrumentCoverage::All));
793792
tracked!(instrument_mcount, true);
794793
tracked!(instrument_xray, Some(InstrumentXRay::default()));
795794
tracked!(link_directives, false);

compiler/rustc_session/src/config.rs

+11-19
Original file line numberDiff line numberDiff line change
@@ -2736,26 +2736,18 @@ pub fn build_session_options(
27362736
_ => {}
27372737
}
27382738

2739-
// Handle both `-Z instrument-coverage` and `-C instrument-coverage`; the latter takes
2740-
// precedence.
2741-
match (cg.instrument_coverage, unstable_opts.instrument_coverage) {
2742-
(Some(ic_c), Some(ic_z)) if ic_c != ic_z => {
2743-
handler.early_error(
2744-
"incompatible values passed for `-C instrument-coverage` \
2745-
and `-Z instrument-coverage`",
2746-
);
2747-
}
2748-
(Some(InstrumentCoverage::Off | InstrumentCoverage::All), _) => {}
2749-
(Some(_), _) if !unstable_opts.unstable_options => {
2750-
handler.early_error("`-C instrument-coverage=except-*` requires `-Z unstable-options`");
2751-
}
2752-
(None, None) => {}
2753-
(None, ic) => {
2754-
handler
2755-
.early_warn("`-Z instrument-coverage` is deprecated; use `-C instrument-coverage`");
2756-
cg.instrument_coverage = ic;
2739+
// Check for unstable values of `-C instrument-coverage`.
2740+
match cg.instrument_coverage {
2741+
Some(InstrumentCoverage::Off | InstrumentCoverage::All) | None => {}
2742+
Some(
2743+
InstrumentCoverage::ExceptUnusedFunctions | InstrumentCoverage::ExceptUnusedGenerics,
2744+
) => {
2745+
if !unstable_opts.unstable_options {
2746+
handler.early_error(
2747+
"`-C instrument-coverage=except-*` requires `-Z unstable-options`",
2748+
);
2749+
}
27572750
}
2758-
_ => {}
27592751
}
27602752

27612753
if cg.instrument_coverage.is_some() && cg.instrument_coverage != Some(InstrumentCoverage::Off) {

compiler/rustc_session/src/options.rs

-9
Original file line numberDiff line numberDiff line change
@@ -1591,15 +1591,6 @@ options! {
15911591
"a default MIR inlining threshold (default: 50)"),
15921592
input_stats: bool = (false, parse_bool, [UNTRACKED],
15931593
"gather statistics about the input (default: no)"),
1594-
#[rustc_lint_opt_deny_field_access("use `Session::instrument_coverage` instead of this field")]
1595-
instrument_coverage: Option<InstrumentCoverage> = (None, parse_instrument_coverage, [TRACKED],
1596-
"instrument the generated code to support LLVM source-based code coverage \
1597-
reports (note, the compiler build config must include `profiler = true`); \
1598-
implies `-C symbol-mangling-version=v0`. Optional values are:
1599-
`=all` (implicit value)
1600-
`=except-unused-generics`
1601-
`=except-unused-functions`
1602-
`=off` (default)"),
16031594
instrument_mcount: bool = (false, parse_bool, [TRACKED],
16041595
"insert function instrument code for mcount-based tracing (default: no)"),
16051596
instrument_xray: Option<InstrumentXRay> = (None, parse_instrument_xray, [TRACKED],

0 commit comments

Comments
 (0)