Function rustc_mir::transform::coverage::spans::function_source_span [−][src]
fn function_source_span(span: Span, body_span: Span) -> (Span, Span)
Expand description
Returns two spans from the given span (the span associated with a
Statement or Terminator):
- An extrapolated span (pre-expansion1) 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_spanis returned. - The actual
spanvalue from theStatement, before expansion.
Only the first span is used when computing coverage code regions. The second span is useful if additional expansion data is needed (such as to look up the macro name for a composed span within that macro).)
1Expansions result from Rust syntax including macros, syntactic sugar, etc.).