rust/compiler/rustc_middle/src
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
..
dep_graph Show a more informative panic message when DefPathHash does not exist 2022-01-19 17:36:44 -05:00
hir Make local_def_id_to_hir_id query directly returh HirId 2022-01-29 08:40:23 -03:00
infer Canonicalize const variables correctly 2022-01-12 08:27:41 -08:00
middle Track drops across multiple yields 2022-01-18 14:25:24 -08:00
mir Rollup merge of #90132 - joshtriplett:stabilize-instrument-coverage, r=wesleywiser 2022-02-04 18:42:13 +01:00
query Rollup merge of #90132 - joshtriplett:stabilize-instrument-coverage, r=wesleywiser 2022-02-04 18:42:13 +01:00
thir Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
traits Do not store overlap_mode, just pass it down on insert 2022-01-31 11:51:34 -03:00
ty Rollup merge of #93593 - JulianKnodt:master, r=oli-obk 2022-02-04 14:59:04 +01:00
util Use AddAssign impl 2021-11-09 23:47:36 +01:00
arena.rs Fully serialize AdtDef 2021-12-15 16:32:16 -05:00
lib.rs add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
lint.rs update FutureIncompatibilityReason 2022-02-01 09:55:19 +01:00
macros.rs Rename TypeFolderFallible to FallibleTypeFolder 2021-12-02 16:14:18 +00:00
metadata.rs rustc_middle: Rename Export to ModChild and add some comments 2022-01-09 09:22:07 +08:00
tests.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
thir.rs Formally implement let chains 2022-01-18 19:38:17 -03:00