Module rustc_mir_transform::coverage::spans
source · Structs
- A BCB is deconstructed into one or more
Span
s. EachSpan
maps to aCoverageSpan
that references the originating BCB and one or more MIRStatement
s and/orTerminator
s. Initially, theSpan
s come from theStatement
s andTerminator
s, but subsequent transforms can combine adjacentSpan
s andCoverageSpan
from the same BCB, merging theCoverageStatement
vectors, and theSpan
s to cover the extent of the combinedSpan
s. - Converts the initial set of
CoverageSpan
s (one per MIRStatement
orTerminator
) into a minimal set ofCoverageSpan
s, using the BCB CFG to determine where it is safe and useful to:
Enums
Functions
- If the MIR
Statement
has a span contributive to computing coverage spans, return it; otherwise returnNone
. - If the MIR
Terminator
has a span contributive to computing coverage spans, return it; otherwise returnNone
. - Returns an extrapolated span (pre-expansion) corresponding to a range within the function’s body source. This span is guaranteed to be contained within, or equal to, the
body_span
. If the extrapolated span is not contained within thebody_span
, thebody_span
is returned.