rust-lang / compiler-team

A home for compiler team planning documents, meeting minutes, and other such things.
https://rust-lang.github.io/compiler-team/
Apache License 2.0
387 stars 69 forks source link

Semantics of `-Cinstrument-coverage=all` #690

Closed Zalathar closed 9 months ago

Zalathar commented 1 year ago

Proposal

Short summary:


(copied from https://github.com/rust-lang/rust/pull/117199, which implements the proposed change)

The option-value parser for -Cinstrument-coverage= currently accepts the following stable values:

I'd like to rearrange and re-document the stable values as follows:

The main changes being:

Why?

The choice of all as the implicit value only really makes sense in the context of the unstable except-unused-functions and except-unused-generics values. That arrangement was fine for an unstable flag, but it's confusing for a stable flag whose only other stable value is off, and will only become more confusing if we eventually want to stabilize other fine-grained coverage option values.

(Currently I'm not aware of any plans to stabilize other coverage option values, but that's why I think now is a fine time to make this change, well before anyone actually has to care about it.)

For example, if we ever add support for opt-in instrumentation of things that are not instrumented by -Cinstrument-coverage by default, it will be very strange for the all value to not actually instrument all things that we know how to instrument.

Compatibility impact

Because this is not a functional change, there is no immediate compatibility impact. However, changing the documented semantics of all opens up the possibility of future changes that could be considered retroactively breaking.

I don't think this is going to be a big deal in practice, for a few reasons:


Mentors or Reviewers

The work is already done; I'm mostly going through MCP because this is technically a user-visible change (and arguably a breaking one).

Process

The main points of the Major Change Process are as follows:

You can read more about Major Change Proposals on forge.

Comments

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

rustbot commented 1 year ago

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

cc @rust-lang/compiler @rust-lang/compiler-contributors

oli-obk commented 10 months ago

@rustbot second

apiraino commented 9 months ago

@rustbot label -final-comment-period +major-change-accepted