rust/compiler/rustc_session/src
Matthias Krüger 8b9ef3b996
Rollup merge of #122226 - Zalathar:zcoverage-options, r=nnethercote
coverage: Remove or migrate all unstable values of `-Cinstrument-coverage`

(This PR was substantially overhauled from its original version, which migrated all of the existing unstable values intact.)

This PR takes the three nightly-only values that are currently accepted by `-Cinstrument-coverage`, completely removes two of them (`except-unused-functions` and `except-unused-generics`), and migrates the third (`branch`) over to a newly-introduced unstable flag `-Zcoverage-options`.

I have a few motivations for wanting to do this:

- It's unclear whether anyone actually uses the `except-unused-*` values, so this serves as an opportunity to either remove them, or prompt existing users to object to their removal.
- After #117199, the stable values of `-Cinstrument-coverage` treat it as a boolean-valued flag, so having nightly-only extra values feels out-of-place.
  - Nightly-only values also require extra ad-hoc code to make sure they aren't accidentally exposed to stable users.
- The new system allows multiple different settings to be toggled independently, which isn't possible in the current single-value system.
- The new system makes it easier to introduce new behaviour behind an unstable toggle, and then gather nightly-user feedback before possibly making it the default behaviour for all users.
- The new system also gives us a convenient place to put relatively-narrow options that won't ever be the default, but that nightly users might still want access to.
- It's likely that we will eventually want to give stable users more fine-grained control over coverage instrumentation. The new flag serves as a prototype of what that stable UI might eventually look like.

The `branch` option is a placeholder that currently does nothing. It will be used by #122322 to opt into branch coverage instrumentation.

---

I see `-Zcoverage-options` as something that will exist more-or-less indefinitely, though individual sub-options might come and go as appropriate. I think there will always be some demand for nightly-only toggles, so I don't see `-Zcoverage-options` itself ever being stable, though we might eventually stabilize something similar to it.
2024-03-13 06:41:22 +01:00
..
config update paths in comments 2024-01-12 00:11:33 +01:00
code_stats.rs rustc_session: Address all rustc::potential_query_instability lints 2023-12-03 15:05:39 +01:00
config.rs coverage: Add -Zcoverage-options for fine control of coverage 2024-03-13 11:14:10 +11:00
cstore.rs Move MetadataLoader{,Dyn} to rustc_metadata. 2023-11-30 17:05:54 +11:00
errors.rs Rename IntoDiagnostic as Diagnostic. 2024-03-11 09:15:09 +11:00
filesearch.rs Rollup merge of #116793 - WaffleLapkin:target_rules_the_backend, r=cjgillot 2024-03-11 09:29:32 -07:00
lib.rs Use generic NonZero internally. 2024-02-15 08:09:42 +01:00
options.rs Rollup merge of #122226 - Zalathar:zcoverage-options, r=nnethercote 2024-03-13 06:41:22 +01:00
output.rs Replace unnecessary abort_if_errors. 2024-02-22 08:03:47 +11:00
parse.rs Rollup merge of #121382 - nnethercote:rework-untranslatable_diagnostic-lint, r=davidtwco 2024-03-06 22:02:46 +01:00
search_paths.rs Rewrite the untranslatable_diagnostic lint. 2024-03-06 14:19:01 +11:00
session.rs coverage: Add -Zcoverage-options for fine control of coverage 2024-03-13 11:14:10 +11:00
utils.rs Use better heuristic for printing Cargo specific diagnostics 2024-02-17 16:49:01 +01:00
version.rs Simplify the current_rustc_version macro. 2023-11-10 10:54:21 +11:00