rustc_mir_transform::coverage::unexpand

Function unexpand_into_body_span_with_prev

source
fn unexpand_into_body_span_with_prev(
    original_span: Span,
    body_span: Span,
) -> Option<(Span, Option<Span>)>
Expand description

Walks through the expansion ancestors of original_span to find a span that is contained in body_span and has the same syntax context as body_span. The ancestor that was traversed just before the matching span (if any) is also returned.

For example, a return value of Some((ancestor, Some(prev))) means that:

  • ancestor == original_span.find_ancestor_inside_same_ctxt(body_span)
  • prev.parent_callsite() == ancestor