Module rustc_mir_transform::coverage::spans::from_mir

source Β·

StructsΒ§

FunctionsΒ§

  • Traverses the MIR body to produce an initial collection of coverage-relevant spans, each associated with a node in the coverage graph (BCB) and possibly other metadata.
  • If the MIR Statement has a span contributive to computing coverage spans, return it; otherwise return None.
  • If the MIR Terminator has a span contributive to computing coverage spans, return it; otherwise return None.
  • is_closure_like πŸ”’
  • Walks through the expansion ancestors of original_span to find a span that is contained in body_span and has the same SyntaxContext as body_span. The ancestor that was traversed just before the matching span (if any) is also returned.
  • 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 the body_span, None is returned.