Function rustc_mir_transform::coverage::spans::remove_unwanted_macro_spans
source · fn remove_unwanted_macro_spans(covspans: &mut Vec<SpanFromMir>)
Expand description
Macros that expand into branches (e.g. assert!
, trace!
) tend to generate
multiple condition/consequent blocks that have the span of the whole macro
invocation, which is unhelpful. Keeping only the first such span seems to
give better mappings, so remove the others.
(The input spans should be sorted in BCB dominator order, so that the retained “first” span is likely to dominate the others.)