Module spans

Source

ModulesΒ§

from_mir πŸ”’

StructsΒ§

Covspan πŸ”’

FunctionsΒ§

compare_spans πŸ”’
Compares two spans in (lo ascending, hi descending) order.
discard_spans_overlapping_holes πŸ”’
Discard all covspans that overlap a hole.
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 a list of sorted spans extracted from MIR, and β€œrefines” those spans by removing spans that overlap in unwanted ways.
shrink_visible_macro_spans πŸ”’
When a span corresponds to a macro invocation that is visible from the function body, truncate it to just the macro name plus !. This seems to give better results for code that uses macros.