1

Unbox and unwrap the contents of `StatementKind::Coverage` by Zalathar · Pull Re...

 4 weeks ago
source link: https://github.com/rust-lang/rust/pull/122937
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Unbox and unwrap the contents of StatementKind::Coverage #122937

Merged

Conversation

Contributor

The payload of coverage statements was historically a structure with several fields, so it was boxed to avoid bloating StatementKind.

Now that the payload is a single relatively-small enum, we can replace Box<Coverage> with just CoverageKind.

This patch also adds a size assertion for StatementKind, to avoid accidentally bloating it in the future.

@rustbot label +A-code-coverage

Collaborator

r? @matthewjasper

rustbot has assigned @matthewjasper.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

rustbot

added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

labels

Mar 23, 2024

Collaborator

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

This PR changes MIR

cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

rustbot

added the A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) label

Mar 23, 2024

Contributor

Author

Changes to rustc_codegen_gcc are trivial API adjustments.

(Maybe I should give CoverageInfoBuilderMethods a default implementation someday.)

Comment on lines

-190 to -192

// Ignore `ConstEvalCounter`s

| StatementKind::ConstEvalCounter

// Ignore `Nop`s

Contributor

Author

I noticed that these comments were preventing rustfmt from formatting this match, presumably due to rust-lang/rustfmt#4119.

Since these particular comments are low-value anyway, I worked around the issue by just deleting them.

Contributor

Contributor

📌 Commit ab92699 has been approved by oli-obk

It is now in the queue for this repository.

bors

added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

labels

Mar 24, 2024

bors

merged commit 19d3827 into

rust-lang:master

Mar 24, 2024

11 checks passed

rust-timer

added a commit to rust-lang-ci/rust that referenced this pull request

Mar 24, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Swatinem

Swatinem approved these changes
Assignees

oli-obk

Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects

None yet

Milestone

1.79.0

Development

Successfully merging this pull request may close these issues.

None yet

6 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK