Repository: rust
Issue: Tracking issue for stabilizing the `#[coverage(..)]` attribute
Labels: C-tracking-issue,A-code-coverage

<!--
NOTE: For library features, please use the "Library Tracking Issue" template instead.

Thank you for creating a tracking issue! 📜 Tracking issues are for tracking a
feature from implementation to stabilisation. Make sure to include the relevant
RFC for the feature if it has one. Otherwise provide a short summary of the
feature and link any relevant PRs or issues, and remove any sections that are
not relevant to the feature.

Remember to add team labels to the tracking issue.
For a language team feature, this would e.g., be `T-lang`.
Such a feature should also be labeled with e.g., `F-my_feature`.
This label is used to associate issues (e.g., bugs and design questions) to the feature.
-->

This is a sub-issue of #84605 for tracking the remaining obstacles to stabilization of the coverage attribute. The `#[coverage(off)]` and `#[coverage(on)]` attributes provide hints for whether `-Cinstrument-coverage` should instrument a particular function or not.

The feature gate for the issue is `#![feature(coverage_attribute)]`.

### About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.

### Steps
<!--
Include each step required to complete the feature. Typically this is a PR
implementing a feature, followed by a PR that stabilises the feature. However
for larger features an implementation could be broken up into multiple PRs.
-->

- [ ] Draft and review user-facing documentation (guide-level and reference-level) that describes the feature, and clearly indicates which aspects are stably guaranteed vs subject to change.
- [ ] Check that the feature is adequately tested.
- [ ] Get clear sign-off from T-lang, including approval of the documented stability boundary.
- [ ] Get clear sign-off from the de-facto code owner (Zalathar) and T-compiler.
- [ ] Adjust error messages and error-code documentation to reflect the current design.
  - #134750
- [ ] New stabilization PR ([see instructions on rustc-dev-guide][stabilization-guide])

[stabilization-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#stabilization-pr

### Unresolved Questions
<!--
Include any open questions that need to be answered before the feature can be
stabilised.
-->

- Which aspects of the attribute are stably guaranteed vs subject to change?

### Implementation history

This functionality was originally introduced as an unstable feature, without a formal RFC. After a period of inactivity, there was a user-led push for stabilization, leading to further design and implementation changes.

A stabilization PR was briefly merged on nightly due to a process mixup, then reverted. This tracking issue picks up after that revert.

<!--
Include a list of all the PRs that were involved in implementing the feature.
-->

- (add earlier PRs here as desired)
- #126721
- #130766
- #134672