Skip to content

MC/DC Coverage re-introduction (1/3): THIR data gathering - #161222

Open
RenjiSann wants to merge 4 commits into
rust-lang:mainfrom
RenjiSann:mcdc-step-thir
Open

MC/DC Coverage re-introduction (1/3): THIR data gathering#161222
RenjiSann wants to merge 4 commits into
rust-lang:mainfrom
RenjiSann:mcdc-step-thir

Conversation

@RenjiSann

Copy link
Copy Markdown
Contributor

Tracking issue: rust-lang/goals#638

Identify MC/DC decision in the AST form, to allow for incoming instrumentation and mappings creation.

  1. Introduce a -Z coverage-options=mcdc flag
  2. Detect boolean expressions in THIR to:
    1. Gather sufficient data to construct MC/DC decisions;
    2. Emit block markers in MIR to track the expressions and instrument them

r? @davidtwco

@rustbot

rustbot commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in match lowering

cc @Nadrieril

Some changes occurred in coverage instrumentation.

cc @Zalathar

Some changes occurred in coverage instrumentation.

cc @Zalathar

@rustbot 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 Aug 17, 2026
@rust-log-analyzer

This comment has been minimized.

@RenjiSann
RenjiSann force-pushed the mcdc-step-thir branch 2 times, most recently from 7e45625 to d04f977 Compare August 17, 2026 16:27
@rust-log-analyzer

This comment has been minimized.

@jyn514

jyn514 commented Aug 19, 2026

Copy link
Copy Markdown
Member

I'm quite confused that you've asked David to review this, who's not a maintainer of the coverage implementation, rather than Zalathar, who is.

@matthiaskrgr

Copy link
Copy Markdown
Member

@jyn514 probably because David is the compiler champion for this goal https://rust-lang.github.io/goals/2026/mcdc-coverage-support.html

@Zalathar

Copy link
Copy Markdown
Member

This PR series (?) seems to rely heavily on re-adding chunks of the old implementation that was specifically removed for imposing a heavy maintenance burden. I would not want that point to go unremarked.

The approach of doing any kind of non-trivial analysis during MIR building also seems like a dead end. It's already not working well for branch coverage, and MC/DC necessarily imposes a much higher complexity burden than branch coverage does.

@rust-bors

rust-bors Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #162009) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

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

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants