@@ -2739,29 +2739,24 @@ pub fn build_session_options(
2739
2739
_ => { }
2740
2740
}
2741
2741
2742
- // Handle both `-Z instrument-coverage` and `-C instrument-coverage`; the latter takes
2743
- // precedence.
2744
- match ( cg. instrument_coverage , unstable_opts. instrument_coverage ) {
2745
- ( Some ( ic_c) , Some ( ic_z) ) if ic_c != ic_z => {
2746
- handler. early_error (
2747
- "incompatible values passed for `-C instrument-coverage` \
2748
- and `-Z instrument-coverage`",
2749
- ) ;
2750
- }
2751
- ( Some ( InstrumentCoverage :: Off | InstrumentCoverage :: All ) , _) => { }
2752
- ( Some ( _) , _) if !unstable_opts. unstable_options => {
2753
- handler. early_error (
2754
- "`-C instrument-coverage=branch` and `-C instrument-coverage=except-*` \
2755
- require `-Z unstable-options`",
2756
- ) ;
2757
- }
2758
- ( None , None ) => { }
2759
- ( None , ic) => {
2760
- handler
2761
- . early_warn ( "`-Z instrument-coverage` is deprecated; use `-C instrument-coverage`" ) ;
2762
- cg. instrument_coverage = ic;
2742
+ // Check for unstable values of `-C instrument-coverage`.
2743
+ // This is what prevents them from being used on stable compilers.
2744
+ match cg. instrument_coverage {
2745
+ // Stable values:
2746
+ Some ( InstrumentCoverage :: All | InstrumentCoverage :: Off ) | None => { }
2747
+ // Unstable values:
2748
+ Some (
2749
+ InstrumentCoverage :: Branch
2750
+ | InstrumentCoverage :: ExceptUnusedFunctions
2751
+ | InstrumentCoverage :: ExceptUnusedGenerics ,
2752
+ ) => {
2753
+ if !unstable_opts. unstable_options {
2754
+ handler. early_error (
2755
+ "`-C instrument-coverage=branch` and `-C instrument-coverage=except-*` \
2756
+ require `-Z unstable-options`",
2757
+ ) ;
2758
+ }
2763
2759
}
2764
- _ => { }
2765
2760
}
2766
2761
2767
2762
if cg. instrument_coverage . is_some ( ) && cg. instrument_coverage != Some ( InstrumentCoverage :: Off ) {
0 commit comments