Module spans

Source

Modules§

from_mir πŸ”’

Structs§

Covspan πŸ”’

Functions§

compare_spans πŸ”’
Compares two spans in (lo ascending, hi descending) order.
divide_spans_into_buckets πŸ”’
Uses the holes to divide the given covspans into buckets, such that:
drain_front_while πŸ”’
Similar to .drain(..), but stops just before it would remove an item not satisfying the predicate.
extract_refined_covspans πŸ”’
remove_unwanted_expansion_spans πŸ”’
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.
remove_unwanted_overlapping_spans πŸ”’
Takes one of the buckets of (sorted) spans extracted from MIR, and β€œrefines” those spans by removing spans that overlap in unwanted ways.
split_visible_macro_spans πŸ”’
When a span corresponds to a macro invocation that is visible from the function body, split it into two parts. The first part covers just the macro name plus !, and the second part covers the rest of the macro invocation. This seems to give better results for code that uses macros.