coverage: Return a nested vector from initial span extraction

This will allow the span extractor to produce multiple separate buckets,
instead of just one flat list of spans.
This commit is contained in:
Zalathar
2024-06-03 15:27:30 +10:00
parent df96cba432
commit 9c931c01f7
2 changed files with 11 additions and 8 deletions

View File

@@ -23,7 +23,7 @@ pub(super) fn mir_to_initial_sorted_coverage_spans(
mir_body: &mir::Body<'_>,
hir_info: &ExtractedHirInfo,
basic_coverage_blocks: &CoverageGraph,
) -> Vec<SpanFromMir> {
) -> Vec<Vec<SpanFromMir>> {
let &ExtractedHirInfo { body_span, .. } = hir_info;
let mut initial_spans = vec![];
@@ -67,7 +67,7 @@ pub(super) fn mir_to_initial_sorted_coverage_spans(
// requires a lot more complexity in the span refiner, for little benefit.)
initial_spans.dedup_by(|b, a| a.span.source_equal(b.span));
initial_spans
vec![initial_spans]
}
/// Macros that expand into branches (e.g. `assert!`, `trace!`) tend to generate