Introduce -C instrument-coverage=branch
to gate branch coverage
This flag has to be used in combination with `-Zunstable-options`, and is added in advance of adding branch coverage instrumentation.
This commit is contained in:
parent
1322f92634
commit
2b36547e9c
7 changed files with 19 additions and 6 deletions
|
@ -169,6 +169,9 @@ pub enum MirSpanview {
|
|||
pub enum InstrumentCoverage {
|
||||
/// Default `-C instrument-coverage` or `-C instrument-coverage=statement`
|
||||
All,
|
||||
/// Additionally, instrument branches and output branch coverage.
|
||||
/// `-Zunstable-options -C instrument-coverage=branch`
|
||||
Branch,
|
||||
/// `-Zunstable-options -C instrument-coverage=except-unused-generics`
|
||||
ExceptUnusedGenerics,
|
||||
/// `-Zunstable-options -C instrument-coverage=except-unused-functions`
|
||||
|
@ -2747,7 +2750,10 @@ pub fn build_session_options(
|
|||
}
|
||||
(Some(InstrumentCoverage::Off | InstrumentCoverage::All), _) => {}
|
||||
(Some(_), _) if !unstable_opts.unstable_options => {
|
||||
handler.early_error("`-C instrument-coverage=except-*` requires `-Z unstable-options`");
|
||||
handler.early_error(
|
||||
"`-C instrument-coverage=branch` and `-C instrument-coverage=except-*` \
|
||||
require `-Z unstable-options`",
|
||||
);
|
||||
}
|
||||
(None, None) => {}
|
||||
(None, ic) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue