WIP: Injects counters before every block (experimental only) #74856
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uses the span from the start of the first statement to the end of the Terminator.
This simple approach does introduce some poor coverage results. For
example, a function that only calls macros (like
println!
, forexample) may only have counters injected at the macro site, and these
may never get counted, for some reason. (I'm seeing some functions with
coverage counts of zero, even though they clearly should be called.)
I'm developing a follow-up change to this one that injects counters more
precisely, by inspecting the Statement and Terminator types, and making
different decisions regarding what blocks should be counted, and what
spans to use to generate the code regions.