rust/compiler
Matthias Krüger 2fe9a32ed2
Rollup merge of #90132 - joshtriplett:stabilize-instrument-coverage, r=wesleywiser
Stabilize `-Z instrument-coverage` as `-C instrument-coverage`

(Tracking issue for `instrument-coverage`: https://github.com/rust-lang/rust/issues/79121)

This PR stabilizes support for instrumentation-based code coverage, previously provided via the `-Z instrument-coverage` option. (Continue supporting `-Z instrument-coverage` for compatibility for now, but show a deprecation warning for it.)

Many, many people have tested this support, and there are numerous reports of it working as expected.

Move the documentation from the unstable book to stable rustc documentation. Update uses and documentation to use the `-C` option.

Addressing questions raised in the tracking issue:

> If/when stabilized, will the compiler flag be updated to -C instrument-coverage? (If so, the -Z variant could also be supported for some time, to ease migrations for existing users and scripts.)

This stabilization PR updates the option to `-C` and keeps the `-Z` variant to ease migration.

> The Rust coverage implementation depends on (and automatically turns on) -Z symbol-mangling-version=v0. Will stabilizing this feature depend on stabilizing v0 symbol-mangling first? If so, what is the current status and timeline?

This stabilization PR depends on https://github.com/rust-lang/rust/pull/90128 , which stabilizes `-C symbol-mangling-version=v0` (but does not change the default symbol-mangling-version).

> The Rust coverage implementation implements the latest version of LLVM's Coverage Mapping Format (version 4), which forces a dependency on LLVM 11 or later. A compiler error is generated if attempting to compile with coverage, and using an older version of LLVM.

Given that LLVM 13 has now been released, requiring LLVM 11 for coverage support seems like a reasonable requirement. If people don't have at least LLVM 11, nothing else breaks; they just can't use coverage support. Given that coverage support currently requires a nightly compiler and LLVM 11 or newer, allowing it on a stable compiler built with LLVM 11 or newer seems like an improvement.

The [tracking issue](https://github.com/rust-lang/rust/issues/79121) and the [issue label A-code-coverage](https://github.com/rust-lang/rust/labels/A-code-coverage) link to a few open issues related to `instrument-coverage`, but none of them seem like showstoppers. All of them seem like improvements and refinements we can make after stabilization.

The original `-Z instrument-coverage` support went through a compiler-team MCP at https://github.com/rust-lang/compiler-team/issues/278 . Based on that, `@pnkfelix` suggested that this needed a stabilization PR and a compiler-team FCP.
2022-02-04 18:42:13 +01:00
..
rustc remove unused jemallocator crate 2022-01-28 16:56:05 +01:00
rustc_apfloat Stabilize iter::zip. 2021-12-14 18:50:31 -04:00
rustc_arena Remove unused dep from rustc_arena 2022-02-02 17:37:14 +01:00
rustc_ast Make Decodable and Decoder infallible. 2022-01-22 10:38:31 +11:00
rustc_ast_lowering More let_else adoptions 2022-02-02 17:11:01 +01:00
rustc_ast_passes add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_ast_pretty Rollup merge of #93515 - dtolnay:convenience, r=davidtwco 2022-02-03 22:20:25 +09:00
rustc_attr More let_else adoptions 2022-02-02 17:11:01 +01:00
rustc_borrowck Rollup merge of #93590 - est31:let_else, r=lcnr 2022-02-02 19:34:07 +01:00
rustc_builtin_macros add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_codegen_cranelift Use an indexmap to avoid sorting LocalDefIds 2022-01-22 22:34:16 -06:00
rustc_codegen_gcc Merge landing_pad and set_cleanup into cleanup_landing_pad 2022-01-24 14:10:05 +01:00
rustc_codegen_llvm Rollup merge of #90132 - joshtriplett:stabilize-instrument-coverage, r=wesleywiser 2022-02-04 18:42:13 +01:00
rustc_codegen_ssa Rollup merge of #90132 - joshtriplett:stabilize-instrument-coverage, r=wesleywiser 2022-02-04 18:42:13 +01:00
rustc_const_eval Rollup merge of #92802 - compiler-errors:deduplicate-stack-trace, r=oli-obk 2022-02-03 22:20:24 +09:00
rustc_data_structures Auto merge of #93432 - Kobzol:stable-hash-isize-hash-compression, r=the8472 2022-02-03 01:08:45 +00:00
rustc_driver Rollup merge of #93566 - Aaron1011:rustc-backtrace, r=davidtwco 2022-02-03 22:20:26 +09:00
rustc_error_codes Rollup merge of #88205 - danii:e0772, r=GuillaumeGomez 2022-01-29 14:46:29 +01:00
rustc_errors add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_expand add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_feature add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_fs_util
rustc_graphviz eplace usages of vec![].into_iter with [].into_iter 2022-01-09 14:09:25 +11:00
rustc_hir Auto merge of #93285 - JulianKnodt:const_eq_2, r=oli-obk 2022-02-01 23:18:01 +00:00
rustc_hir_pretty try apply rustc_pass_by_value to Span 2022-01-27 11:29:41 +01:00
rustc_incremental add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_index implement lint for suspicious auto trait impls 2022-02-01 09:55:19 +01:00
rustc_infer Auto merge of #93285 - JulianKnodt:const_eq_2, r=oli-obk 2022-02-01 23:18:01 +00:00
rustc_interface Rollup merge of #90132 - joshtriplett:stabilize-instrument-coverage, r=wesleywiser 2022-02-04 18:42:13 +01:00
rustc_lexer Auto merge of #91393 - Julian-Wollersberger:lexer_optimization, r=petrochenkov 2021-12-03 13:20:14 +00:00
rustc_lint Rollup merge of #93290 - lcnr:same_type, r=jackh726 2022-02-01 16:08:05 +01:00
rustc_lint_defs implement lint for suspicious auto trait impls 2022-02-01 09:55:19 +01:00
rustc_llvm Windows: Disable LLVM crash dialog boxes. 2022-01-27 16:53:17 -08:00
rustc_log Make rustc_log doc test runnable 2022-01-03 22:31:56 -08:00
rustc_macros Make Decodable and Decoder infallible. 2022-01-22 10:38:31 +11:00
rustc_metadata add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_middle Rollup merge of #90132 - joshtriplett:stabilize-instrument-coverage, r=wesleywiser 2022-02-04 18:42:13 +01:00
rustc_mir_build Rollup merge of #93589 - est31:option_then, r=cjgillot 2022-02-03 22:20:27 +09:00
rustc_mir_dataflow rustc_mir_dataflow: use iter::once instead of Some().into_iter 2022-02-03 13:52:26 -07:00
rustc_mir_transform Rollup merge of #90132 - joshtriplett:stabilize-instrument-coverage, r=wesleywiser 2022-02-04 18:42:13 +01:00
rustc_monomorphize add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_parse clippy::perf fixes 2022-02-03 21:45:51 +01:00
rustc_parse_format
rustc_passes Auto merge of #93466 - cjgillot:query-dead, r=nagisa 2022-02-02 02:29:32 +00:00
rustc_plugin_impl replace dynamic library module with libloading 2021-12-06 12:03:47 -05:00
rustc_privacy add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_query_impl add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_query_system Use Option::then in two places 2022-02-02 16:10:16 +01:00
rustc_resolve Auto merge of #93312 - pierwill:map-all-local-trait-impls, r=cjgillot 2022-02-02 15:36:12 +00:00
rustc_save_analysis More let_else adoptions 2022-02-02 17:11:01 +01:00
rustc_serialize Remove two unnecessary transmutes from opaque Encoder and Decoder 2022-01-31 18:25:05 +01:00
rustc_session Rollup merge of #90132 - joshtriplett:stabilize-instrument-coverage, r=wesleywiser 2022-02-04 18:42:13 +01:00
rustc_span add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_symbol_mangling add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_target Rollup merge of #92021 - woodenarrow:br_single_fp_element, r=Mark-Simulacrum 2022-02-01 16:08:03 +01:00
rustc_trait_selection Auto merge of #93285 - JulianKnodt:const_eq_2, r=oli-obk 2022-02-01 23:18:01 +00:00
rustc_traits Remove generalization over projection 2022-01-28 00:25:36 +00:00
rustc_ty_utils remove TyS::same_type 2022-02-01 11:21:26 +01:00
rustc_type_ir initial revert 2022-01-15 01:16:55 +00:00
rustc_typeck Rollup merge of #93630 - matthiaskrgr:clipperf, r=oli-obk 2022-02-04 14:59:05 +01:00