Skip to content

Commit 3b82d46

Browse files
Rollup merge of #139966 - Zalathar:span-merge, r=oli-obk
coverage: Only merge adjacent coverage spans For a long time, coverage instrumentation has automatically “merged” spans with the same control-flow into a smaller number of larger spans, even when the spans being merged are not overlapping or adjacent. This causes any source text between the original spans to be included in the merged span, which is then associated with an execution count when shown in coverage reports. That approach causes a number of problems: - The intervening source text can contain all sorts of things that shouldn't really be marked as executable code (e.g. nested items, parts of macro invocations, long comments). In some cases we have complicated workarounds (e.g. bucketing to avoid merging spans across nested items), but in other cases there isn't much we can do. - Merging can have aesthetically weird effects, such as including unbalanced parentheses, because the merging process doesn't really understand what it's doing at a source code level. - It generally leads to an accumulation of piled-on heuristics and special cases that give decent-looking results, but are fiendishly difficult to modify or replace. Therefore, this PR aims to abolish the merging of non-adjacent coverage spans. The big tradeoff here is that the resulting coverage metadata (embedded in the instrumented binary) tends to become larger, because the overall number of distinct spans has increased. That's unfortunate, but I see it as the inevitable cost of cleaning up the messes and inaccuracies that were caused by the old approach. And the resulting spans do tend to be more accurate to the program's actual control-flow. --- The `.coverage` snapshot changes give an indication of how this PR will affect user-visible coverage reports. In many cases the changes to reporting are minor or even nonexistent, despite substantial changes to the metadata (as indicated by `.cov-map` snapshots). --- try-job: aarch64-gnu
2 parents 8929f8a + 77a7ae4 commit 3b82d46

File tree

139 files changed

+2895
-1858
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+2895
-1858
lines changed

compiler/rustc_mir_transform/src/coverage/mappings.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub(super) fn extract_all_mapping_info_from_mir<'tcx>(
9191
// When debugging flag `-Zcoverage-options=no-mir-spans` is set, we need
9292
// to give the same treatment to _all_ functions, because `llvm-cov`
9393
// seems to ignore functions that don't have any ordinary code spans.
94-
if let Some(span) = hir_info.fn_sig_span_extended {
94+
if let Some(span) = hir_info.fn_sig_span {
9595
code_mappings.push(CodeMapping { span, bcb: START_BCB });
9696
}
9797
} else {

compiler/rustc_mir_transform/src/coverage/mod.rs

+11-21
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,9 @@ fn inject_statement(mir_body: &mut mir::Body<'_>, counter_kind: CoverageKind, bb
268268
struct ExtractedHirInfo {
269269
function_source_hash: u64,
270270
is_async_fn: bool,
271-
/// The span of the function's signature, extended to the start of `body_span`.
271+
/// The span of the function's signature, if available.
272272
/// Must have the same context and filename as the body span.
273-
fn_sig_span_extended: Option<Span>,
273+
fn_sig_span: Option<Span>,
274274
body_span: Span,
275275
/// "Holes" are regions within the function body (or its expansions) that
276276
/// should not be included in coverage spans for this function
@@ -308,30 +308,20 @@ fn extract_hir_info<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> ExtractedHir
308308

309309
// The actual signature span is only used if it has the same context and
310310
// filename as the body, and precedes the body.
311-
let fn_sig_span_extended = maybe_fn_sig
312-
.map(|fn_sig| fn_sig.span)
313-
.filter(|&fn_sig_span| {
314-
let source_map = tcx.sess.source_map();
315-
let file_idx = |span: Span| source_map.lookup_source_file_idx(span.lo());
316-
317-
fn_sig_span.eq_ctxt(body_span)
318-
&& fn_sig_span.hi() <= body_span.lo()
319-
&& file_idx(fn_sig_span) == file_idx(body_span)
320-
})
321-
// If so, extend it to the start of the body span.
322-
.map(|fn_sig_span| fn_sig_span.with_hi(body_span.lo()));
311+
let fn_sig_span = maybe_fn_sig.map(|fn_sig| fn_sig.span).filter(|&fn_sig_span| {
312+
let source_map = tcx.sess.source_map();
313+
let file_idx = |span: Span| source_map.lookup_source_file_idx(span.lo());
314+
315+
fn_sig_span.eq_ctxt(body_span)
316+
&& fn_sig_span.hi() <= body_span.lo()
317+
&& file_idx(fn_sig_span) == file_idx(body_span)
318+
});
323319

324320
let function_source_hash = hash_mir_source(tcx, hir_body);
325321

326322
let hole_spans = extract_hole_spans_from_hir(tcx, hir_body);
327323

328-
ExtractedHirInfo {
329-
function_source_hash,
330-
is_async_fn,
331-
fn_sig_span_extended,
332-
body_span,
333-
hole_spans,
334-
}
324+
ExtractedHirInfo { function_source_hash, is_async_fn, fn_sig_span, body_span, hole_spans }
335325
}
336326

337327
fn hash_mir_source<'tcx>(tcx: TyCtxt<'tcx>, hir_body: &'tcx hir::Body<'tcx>) -> u64 {

compiler/rustc_mir_transform/src/coverage/spans.rs

+47-71
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
use std::collections::VecDeque;
2-
use std::iter;
3-
41
use rustc_data_structures::fx::FxHashSet;
52
use rustc_middle::mir;
63
use rustc_middle::ty::TyCtxt;
74
use rustc_span::{DesugaringKind, ExpnKind, MacroKind, Span};
8-
use tracing::{debug, debug_span, instrument};
5+
use tracing::instrument;
96

107
use crate::coverage::graph::{BasicCoverageBlock, CoverageGraph};
118
use crate::coverage::spans::from_mir::{Hole, RawSpanFromMir, SpanFromMir};
@@ -42,12 +39,12 @@ pub(super) fn extract_refined_covspans<'tcx>(
4239
return;
4340
}
4441

45-
// Also add the adjusted function signature span, if available.
42+
// Also add the function signature span, if available.
4643
// Otherwise, add a fake span at the start of the body, to avoid an ugly
4744
// gap between the start of the body and the first real span.
4845
// FIXME: Find a more principled way to solve this problem.
4946
covspans.push(SpanFromMir::for_fn_sig(
50-
hir_info.fn_sig_span_extended.unwrap_or_else(|| body_span.shrink_to_lo()),
47+
hir_info.fn_sig_span.unwrap_or_else(|| body_span.shrink_to_lo()),
5148
));
5249

5350
// First, perform the passes that need macro information.
@@ -83,24 +80,17 @@ pub(super) fn extract_refined_covspans<'tcx>(
8380
holes.sort_by(|a, b| compare_spans(a.span, b.span));
8481
holes.dedup_by(|b, a| a.merge_if_overlapping_or_adjacent(b));
8582

86-
// Split the covspans into separate buckets that don't overlap any holes.
87-
let buckets = divide_spans_into_buckets(covspans, &holes);
88-
89-
for covspans in buckets {
90-
let _span = debug_span!("processing bucket", ?covspans).entered();
83+
// Discard any span that overlaps with a hole.
84+
discard_spans_overlapping_holes(&mut covspans, &holes);
9185

92-
let mut covspans = remove_unwanted_overlapping_spans(covspans);
93-
debug!(?covspans, "after removing overlaps");
86+
// Perform more refinement steps after holes have been dealt with.
87+
let mut covspans = remove_unwanted_overlapping_spans(covspans);
88+
covspans.dedup_by(|b, a| a.merge_if_eligible(b));
9489

95-
// Do one last merge pass, to simplify the output.
96-
covspans.dedup_by(|b, a| a.merge_if_eligible(b));
97-
debug!(?covspans, "after merge");
98-
99-
code_mappings.extend(covspans.into_iter().map(|Covspan { span, bcb }| {
100-
// Each span produced by the refiner represents an ordinary code region.
101-
mappings::CodeMapping { span, bcb }
102-
}));
103-
}
90+
code_mappings.extend(covspans.into_iter().map(|Covspan { span, bcb }| {
91+
// Each span produced by the refiner represents an ordinary code region.
92+
mappings::CodeMapping { span, bcb }
93+
}));
10494
}
10595

10696
/// Macros that expand into branches (e.g. `assert!`, `trace!`) tend to generate
@@ -142,52 +132,36 @@ fn shrink_visible_macro_spans(tcx: TyCtxt<'_>, covspans: &mut Vec<SpanFromMir>)
142132
}
143133
}
144134

145-
/// Uses the holes to divide the given covspans into buckets, such that:
146-
/// - No span in any hole overlaps a bucket (discarding spans if necessary).
147-
/// - The spans in each bucket are strictly after all spans in previous buckets,
148-
/// and strictly before all spans in subsequent buckets.
135+
/// Discard all covspans that overlap a hole.
149136
///
150-
/// The lists of covspans and holes must be sorted.
151-
/// The resulting buckets are sorted relative to each other, and each bucket's
152-
/// contents are sorted.
153-
#[instrument(level = "debug")]
154-
fn divide_spans_into_buckets(input_covspans: Vec<Covspan>, holes: &[Hole]) -> Vec<Vec<Covspan>> {
155-
debug_assert!(input_covspans.is_sorted_by(|a, b| compare_spans(a.span, b.span).is_le()));
137+
/// The lists of covspans and holes must be sorted, and any holes that overlap
138+
/// with each other must have already been merged.
139+
fn discard_spans_overlapping_holes(covspans: &mut Vec<Covspan>, holes: &[Hole]) {
140+
debug_assert!(covspans.is_sorted_by(|a, b| compare_spans(a.span, b.span).is_le()));
156141
debug_assert!(holes.is_sorted_by(|a, b| compare_spans(a.span, b.span).is_le()));
142+
debug_assert!(holes.array_windows().all(|[a, b]| !a.span.overlaps_or_adjacent(b.span)));
143+
144+
let mut curr_hole = 0usize;
145+
let mut overlaps_hole = |covspan: &Covspan| -> bool {
146+
while let Some(hole) = holes.get(curr_hole) {
147+
// Both lists are sorted, so we can permanently skip any holes that
148+
// end before the start of the current span.
149+
if hole.span.hi() <= covspan.span.lo() {
150+
curr_hole += 1;
151+
continue;
152+
}
157153

158-
// Now we're ready to start grouping spans into buckets separated by holes.
159-
160-
let mut input_covspans = VecDeque::from(input_covspans);
161-
162-
// For each hole:
163-
// - Identify the spans that are entirely or partly before the hole.
164-
// - Discard any that overlap with the hole.
165-
// - Add the remaining identified spans to the corresponding bucket.
166-
let mut buckets = (0..holes.len()).map(|_| vec![]).collect::<Vec<_>>();
167-
for (hole, bucket) in holes.iter().zip(&mut buckets) {
168-
bucket.extend(
169-
drain_front_while(&mut input_covspans, |c| c.span.lo() < hole.span.hi())
170-
.filter(|c| !c.span.overlaps(hole.span)),
171-
);
172-
}
173-
174-
// Any remaining spans form their own final bucket, after the final hole.
175-
// (If there were no holes, this will just be all of the initial spans.)
176-
buckets.push(Vec::from(input_covspans));
154+
return hole.span.overlaps(covspan.span);
155+
}
177156

178-
buckets
179-
}
157+
// No holes left, so this covspan doesn't overlap with any holes.
158+
false
159+
};
180160

181-
/// Similar to `.drain(..)`, but stops just before it would remove an item not
182-
/// satisfying the predicate.
183-
fn drain_front_while<'a, T>(
184-
queue: &'a mut VecDeque<T>,
185-
mut pred_fn: impl FnMut(&T) -> bool,
186-
) -> impl Iterator<Item = T> {
187-
iter::from_fn(move || queue.pop_front_if(|x| pred_fn(x)))
161+
covspans.retain(|covspan| !overlaps_hole(covspan));
188162
}
189163

190-
/// Takes one of the buckets of (sorted) spans extracted from MIR, and "refines"
164+
/// Takes a list of sorted spans extracted from MIR, and "refines"
191165
/// those spans by removing spans that overlap in unwanted ways.
192166
#[instrument(level = "debug")]
193167
fn remove_unwanted_overlapping_spans(sorted_spans: Vec<Covspan>) -> Vec<Covspan> {
@@ -227,19 +201,21 @@ struct Covspan {
227201
}
228202

229203
impl Covspan {
230-
/// If `self` and `other` can be merged (i.e. they have the same BCB),
231-
/// mutates `self.span` to also include `other.span` and returns true.
204+
/// If `self` and `other` can be merged, mutates `self.span` to also
205+
/// include `other.span` and returns true.
232206
///
233-
/// Note that compatible covspans can be merged even if their underlying
234-
/// spans are not overlapping/adjacent; any space between them will also be
235-
/// part of the merged covspan.
207+
/// Two covspans can be merged if they have the same BCB, and they are
208+
/// overlapping or adjacent.
236209
fn merge_if_eligible(&mut self, other: &Self) -> bool {
237-
if self.bcb != other.bcb {
238-
return false;
210+
let eligible_for_merge =
211+
|a: &Self, b: &Self| (a.bcb == b.bcb) && a.span.overlaps_or_adjacent(b.span);
212+
213+
if eligible_for_merge(self, other) {
214+
self.span = self.span.to(other.span);
215+
true
216+
} else {
217+
false
239218
}
240-
241-
self.span = self.span.to(other.span);
242-
true
243219
}
244220
}
245221

tests/coverage/abort.cov-map

+18-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Function name: abort::main
2-
Raw bytes (83): 0x[01, 01, 07, 05, 01, 05, 0b, 01, 09, 05, 13, 01, 0d, 05, 1b, 01, 11, 0d, 01, 0d, 01, 01, 1b, 05, 02, 0b, 00, 18, 02, 01, 0c, 00, 19, 09, 00, 1a, 02, 0a, 06, 02, 09, 00, 0a, 02, 02, 0c, 00, 19, 0d, 00, 1a, 00, 31, 0e, 00, 30, 00, 31, 02, 04, 0c, 00, 19, 11, 00, 1a, 00, 31, 16, 00, 30, 00, 31, 02, 01, 09, 00, 17, 01, 02, 05, 01, 02]
2+
Raw bytes (98): 0x[01, 01, 07, 05, 01, 05, 0b, 01, 09, 05, 13, 01, 0d, 05, 1b, 01, 11, 10, 01, 0d, 01, 00, 1c, 01, 01, 09, 00, 16, 01, 00, 19, 00, 1b, 05, 01, 0b, 00, 18, 02, 01, 0c, 00, 19, 09, 00, 1a, 02, 0a, 06, 02, 09, 00, 0a, 02, 02, 0c, 00, 19, 0d, 00, 1a, 00, 31, 0e, 00, 30, 00, 31, 02, 04, 0c, 00, 19, 11, 00, 1a, 00, 31, 16, 00, 30, 00, 31, 02, 01, 09, 00, 17, 01, 02, 05, 00, 0b, 01, 01, 01, 00, 02]
33
Number of files: 1
44
- file 0 => $DIR/abort.rs
55
Number of expressions: 7
@@ -10,9 +10,11 @@ Number of expressions: 7
1010
- expression 4 operands: lhs = Counter(0), rhs = Counter(3)
1111
- expression 5 operands: lhs = Counter(1), rhs = Expression(6, Add)
1212
- expression 6 operands: lhs = Counter(0), rhs = Counter(4)
13-
Number of file 0 mappings: 13
14-
- Code(Counter(0)) at (prev + 13, 1) to (start + 1, 27)
15-
- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 24)
13+
Number of file 0 mappings: 16
14+
- Code(Counter(0)) at (prev + 13, 1) to (start + 0, 28)
15+
- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22)
16+
- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 27)
17+
- Code(Counter(1)) at (prev + 1, 11) to (start + 0, 24)
1618
- Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 0, 25)
1719
= (c1 - c0)
1820
- Code(Counter(2)) at (prev + 0, 26) to (start + 2, 10)
@@ -30,19 +32,25 @@ Number of file 0 mappings: 13
3032
= (c1 - (c0 + c4))
3133
- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 23)
3234
= (c1 - c0)
33-
- Code(Counter(0)) at (prev + 2, 5) to (start + 1, 2)
35+
- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 11)
36+
- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
3437
Highest counter ID seen: c4
3538

3639
Function name: abort::might_abort
37-
Raw bytes (21): 0x[01, 01, 01, 01, 05, 03, 01, 03, 01, 01, 14, 05, 02, 09, 01, 0f, 02, 02, 0c, 03, 02]
40+
Raw bytes (41): 0x[01, 01, 01, 01, 05, 07, 01, 03, 01, 00, 2e, 01, 01, 08, 00, 14, 05, 01, 09, 00, 11, 05, 00, 12, 00, 1f, 05, 01, 09, 00, 0f, 02, 01, 0c, 02, 06, 02, 03, 01, 00, 02]
3841
Number of files: 1
3942
- file 0 => $DIR/abort.rs
4043
Number of expressions: 1
4144
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
42-
Number of file 0 mappings: 3
43-
- Code(Counter(0)) at (prev + 3, 1) to (start + 1, 20)
44-
- Code(Counter(1)) at (prev + 2, 9) to (start + 1, 15)
45-
- Code(Expression(0, Sub)) at (prev + 2, 12) to (start + 3, 2)
45+
Number of file 0 mappings: 7
46+
- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 46)
47+
- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 20)
48+
- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 17)
49+
- Code(Counter(1)) at (prev + 0, 18) to (start + 0, 31)
50+
- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 15)
51+
- Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 2, 6)
52+
= (c0 - c1)
53+
- Code(Expression(0, Sub)) at (prev + 3, 1) to (start + 0, 2)
4654
= (c0 - c1)
4755
Highest counter ID seen: c1
4856

tests/coverage/assert-ne.cov-map

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
Function name: assert_ne::main
2-
Raw bytes (28): 0x[01, 01, 02, 01, 05, 01, 09, 04, 01, 08, 01, 03, 15, 05, 04, 0d, 00, 13, 02, 02, 0d, 00, 13, 06, 03, 05, 01, 02]
2+
Raw bytes (55): 0x[01, 01, 03, 01, 05, 01, 09, 01, 09, 09, 01, 08, 01, 00, 0a, 01, 01, 05, 00, 0f, 01, 01, 09, 00, 12, 01, 00, 13, 00, 19, 01, 01, 0c, 00, 15, 05, 01, 0d, 00, 13, 02, 02, 0d, 00, 13, 0a, 03, 05, 00, 07, 0a, 01, 01, 00, 02]
33
Number of files: 1
44
- file 0 => $DIR/assert-ne.rs
5-
Number of expressions: 2
5+
Number of expressions: 3
66
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
77
- expression 1 operands: lhs = Counter(0), rhs = Counter(2)
8-
Number of file 0 mappings: 4
9-
- Code(Counter(0)) at (prev + 8, 1) to (start + 3, 21)
10-
- Code(Counter(1)) at (prev + 4, 13) to (start + 0, 19)
8+
- expression 2 operands: lhs = Counter(0), rhs = Counter(2)
9+
Number of file 0 mappings: 9
10+
- Code(Counter(0)) at (prev + 8, 1) to (start + 0, 10)
11+
- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
12+
- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 18)
13+
- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 25)
14+
- Code(Counter(0)) at (prev + 1, 12) to (start + 0, 21)
15+
- Code(Counter(1)) at (prev + 1, 13) to (start + 0, 19)
1116
- Code(Expression(0, Sub)) at (prev + 2, 13) to (start + 0, 19)
1217
= (c0 - c1)
13-
- Code(Expression(1, Sub)) at (prev + 3, 5) to (start + 1, 2)
18+
- Code(Expression(2, Sub)) at (prev + 3, 5) to (start + 0, 7)
19+
= (c0 - c2)
20+
- Code(Expression(2, Sub)) at (prev + 1, 1) to (start + 0, 2)
1421
= (c0 - c2)
1522
Highest counter ID seen: c1
1623

tests/coverage/assert.cov-map

+15-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Function name: assert::main
2-
Raw bytes (61): 0x[01, 01, 06, 05, 01, 05, 17, 01, 09, 05, 13, 17, 0d, 01, 09, 09, 01, 09, 01, 01, 1b, 05, 02, 0b, 00, 18, 02, 01, 0c, 00, 1a, 09, 00, 1b, 02, 0a, 06, 02, 13, 00, 20, 0d, 00, 21, 02, 0a, 0e, 02, 09, 00, 0a, 02, 01, 09, 00, 17, 01, 02, 05, 01, 02]
2+
Raw bytes (76): 0x[01, 01, 06, 05, 01, 05, 17, 01, 09, 05, 13, 17, 0d, 01, 09, 0c, 01, 09, 01, 00, 1c, 01, 01, 09, 00, 16, 01, 00, 19, 00, 1b, 05, 01, 0b, 00, 18, 02, 01, 0c, 00, 1a, 09, 00, 1b, 02, 0a, 06, 02, 13, 00, 20, 0d, 00, 21, 02, 0a, 0e, 02, 09, 00, 0a, 02, 01, 09, 00, 17, 01, 02, 05, 00, 0b, 01, 01, 01, 00, 02]
33
Number of files: 1
44
- file 0 => $DIR/assert.rs
55
Number of expressions: 6
@@ -9,9 +9,11 @@ Number of expressions: 6
99
- expression 3 operands: lhs = Counter(1), rhs = Expression(4, Add)
1010
- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(3)
1111
- expression 5 operands: lhs = Counter(0), rhs = Counter(2)
12-
Number of file 0 mappings: 9
13-
- Code(Counter(0)) at (prev + 9, 1) to (start + 1, 27)
14-
- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 24)
12+
Number of file 0 mappings: 12
13+
- Code(Counter(0)) at (prev + 9, 1) to (start + 0, 28)
14+
- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22)
15+
- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 27)
16+
- Code(Counter(1)) at (prev + 1, 11) to (start + 0, 24)
1517
- Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 0, 26)
1618
= (c1 - c0)
1719
- Code(Counter(2)) at (prev + 0, 27) to (start + 2, 10)
@@ -22,18 +24,22 @@ Number of file 0 mappings: 9
2224
= (c1 - ((c0 + c2) + c3))
2325
- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 23)
2426
= (c1 - c0)
25-
- Code(Counter(0)) at (prev + 2, 5) to (start + 1, 2)
27+
- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 11)
28+
- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
2629
Highest counter ID seen: c3
2730

2831
Function name: assert::might_fail_assert
29-
Raw bytes (21): 0x[01, 01, 01, 01, 05, 03, 01, 04, 01, 02, 0f, 02, 02, 25, 00, 3d, 05, 01, 01, 00, 02]
32+
Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 04, 01, 00, 28, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 20, 01, 01, 05, 00, 0f, 02, 00, 25, 00, 3d, 05, 01, 01, 00, 02]
3033
Number of files: 1
3134
- file 0 => $DIR/assert.rs
3235
Number of expressions: 1
3336
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
34-
Number of file 0 mappings: 3
35-
- Code(Counter(0)) at (prev + 4, 1) to (start + 2, 15)
36-
- Code(Expression(0, Sub)) at (prev + 2, 37) to (start + 0, 61)
37+
Number of file 0 mappings: 6
38+
- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 40)
39+
- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
40+
- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 32)
41+
- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
42+
- Code(Expression(0, Sub)) at (prev + 0, 37) to (start + 0, 61)
3743
= (c0 - c1)
3844
- Code(Counter(1)) at (prev + 1, 1) to (start + 0, 2)
3945
Highest counter ID seen: c1

tests/coverage/assert_not.cov-map

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
Function name: assert_not::main
2-
Raw bytes (29): 0x[01, 01, 00, 05, 01, 06, 01, 01, 11, 01, 02, 05, 00, 13, 01, 01, 05, 00, 13, 01, 01, 05, 00, 15, 01, 01, 01, 00, 02]
2+
Raw bytes (54): 0x[01, 01, 00, 0a, 01, 06, 01, 00, 0a, 01, 01, 05, 00, 0c, 01, 00, 0d, 00, 11, 01, 01, 05, 00, 0c, 01, 00, 0d, 00, 13, 01, 01, 05, 00, 0c, 01, 00, 0d, 00, 13, 01, 01, 05, 00, 0c, 01, 00, 0d, 00, 15, 01, 01, 01, 00, 02]
33
Number of files: 1
44
- file 0 => $DIR/assert_not.rs
55
Number of expressions: 0
6-
Number of file 0 mappings: 5
7-
- Code(Counter(0)) at (prev + 6, 1) to (start + 1, 17)
8-
- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 19)
9-
- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 19)
10-
- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 21)
6+
Number of file 0 mappings: 10
7+
- Code(Counter(0)) at (prev + 6, 1) to (start + 0, 10)
8+
- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 12)
9+
- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 17)
10+
- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 12)
11+
- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 19)
12+
- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 12)
13+
- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 19)
14+
- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 12)
15+
- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 21)
1116
- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
1217
Highest counter ID seen: c0
1318

0 commit comments

Comments
 (0)