rustc_mir_transform/coverage/
unexpand.rs

1use rustc_span::Span;
2
3/// Walks through the expansion ancestors of `original_span` to find a span that
4/// is contained in `body_span` and has the same [syntax context] as `body_span`.
5pub(crate) fn unexpand_into_body_span(original_span: Span, body_span: Span) -> Option<Span> {
6    // Because we don't need to return any extra ancestor information,
7    // we can just delegate directly to `find_ancestor_inside_same_ctxt`.
8    original_span.find_ancestor_inside_same_ctxt(body_span)
9}