Rollup merge of #117111 - Zalathar:zinstrument, r=compiler-errors
Remove support for alias `-Z instrument-coverage` This flag was stabilized in rustc 1.60.0 (2022-04-07) as `-C instrument-coverage`, but the old unstable flag was kept around (with a warning) as an alias to ease migration. It should now be reasonable to remove the somewhat tricky code that implemented that alias. Fixes #116980.
This commit is contained in:
commit
24254d2142
@ -789,7 +789,6 @@ fn test_unstable_options_tracking_hash() {
|
||||
tracked!(inline_mir, Some(true));
|
||||
tracked!(inline_mir_hint_threshold, Some(123));
|
||||
tracked!(inline_mir_threshold, Some(123));
|
||||
tracked!(instrument_coverage, Some(InstrumentCoverage::All));
|
||||
tracked!(instrument_mcount, true);
|
||||
tracked!(instrument_xray, Some(InstrumentXRay::default()));
|
||||
tracked!(link_directives, false);
|
||||
|
@ -2739,29 +2739,24 @@ pub fn build_session_options(
|
||||
_ => {}
|
||||
}
|
||||
|
||||
// Handle both `-Z instrument-coverage` and `-C instrument-coverage`; the latter takes
|
||||
// precedence.
|
||||
match (cg.instrument_coverage, unstable_opts.instrument_coverage) {
|
||||
(Some(ic_c), Some(ic_z)) if ic_c != ic_z => {
|
||||
handler.early_error(
|
||||
"incompatible values passed for `-C instrument-coverage` \
|
||||
and `-Z instrument-coverage`",
|
||||
);
|
||||
}
|
||||
(Some(InstrumentCoverage::Off | InstrumentCoverage::All), _) => {}
|
||||
(Some(_), _) if !unstable_opts.unstable_options => {
|
||||
// Check for unstable values of `-C instrument-coverage`.
|
||||
// This is what prevents them from being used on stable compilers.
|
||||
match cg.instrument_coverage {
|
||||
// Stable values:
|
||||
Some(InstrumentCoverage::All | InstrumentCoverage::Off) | None => {}
|
||||
// Unstable values:
|
||||
Some(
|
||||
InstrumentCoverage::Branch
|
||||
| InstrumentCoverage::ExceptUnusedFunctions
|
||||
| InstrumentCoverage::ExceptUnusedGenerics,
|
||||
) => {
|
||||
if !unstable_opts.unstable_options {
|
||||
handler.early_error(
|
||||
"`-C instrument-coverage=branch` and `-C instrument-coverage=except-*` \
|
||||
require `-Z unstable-options`",
|
||||
);
|
||||
}
|
||||
(None, None) => {}
|
||||
(None, ic) => {
|
||||
handler
|
||||
.early_warn("`-Z instrument-coverage` is deprecated; use `-C instrument-coverage`");
|
||||
cg.instrument_coverage = ic;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
if cg.instrument_coverage.is_some() && cg.instrument_coverage != Some(InstrumentCoverage::Off) {
|
||||
|
@ -1593,16 +1593,6 @@ options! {
|
||||
"a default MIR inlining threshold (default: 50)"),
|
||||
input_stats: bool = (false, parse_bool, [UNTRACKED],
|
||||
"gather statistics about the input (default: no)"),
|
||||
#[rustc_lint_opt_deny_field_access("use `Session::instrument_coverage` instead of this field")]
|
||||
instrument_coverage: Option<InstrumentCoverage> = (None, parse_instrument_coverage, [TRACKED],
|
||||
"instrument the generated code to support LLVM source-based code coverage \
|
||||
reports (note, the compiler build config must include `profiler = true`); \
|
||||
implies `-C symbol-mangling-version=v0`. Optional values are:
|
||||
`=all` (implicit value)
|
||||
`=branch`
|
||||
`=except-unused-generics`
|
||||
`=except-unused-functions`
|
||||
`=off` (default)"),
|
||||
instrument_mcount: bool = (false, parse_bool, [TRACKED],
|
||||
"insert function instrument code for mcount-based tracing (default: no)"),
|
||||
instrument_xray: Option<InstrumentXRay> = (None, parse_instrument_xray, [TRACKED],
|
||||
|
@ -1,3 +0,0 @@
|
||||
// compile-flags: -Cinstrument-coverage=except-unused-functions
|
||||
|
||||
fn main() {}
|
@ -1,3 +0,0 @@
|
||||
// compile-flags: -Cinstrument-coverage=except-unused-generics
|
||||
|
||||
fn main() {}
|
@ -0,0 +1,2 @@
|
||||
error: `-C instrument-coverage=branch` and `-C instrument-coverage=except-*` require `-Z unstable-options`
|
||||
|
6
tests/ui/instrument-coverage/unstable.rs
Normal file
6
tests/ui/instrument-coverage/unstable.rs
Normal file
@ -0,0 +1,6 @@
|
||||
// revisions: branch except-unused-functions except-unused-generics
|
||||
// [branch] compile-flags: -Cinstrument-coverage=branch
|
||||
// [except-unused-functions] compile-flags: -Cinstrument-coverage=except-unused-functions
|
||||
// [except-unused-generics] compile-flags: -Cinstrument-coverage=except-unused-generics
|
||||
|
||||
fn main() {}
|
Loading…
x
Reference in New Issue
Block a user