@@ -251,32 +251,9 @@ impl<'a> CoverageSpansGenerator<'a> {
251
251
} else if curr. is_closure {
252
252
self . carve_out_span_for_closure ( ) ;
253
253
} else if self . prev_original_span == curr. span {
254
- // Note that this compares the new (`curr`) span to `prev_original_span`.
255
- // In this branch, the actual span byte range of `prev_original_span` is not
256
- // important. What is important is knowing whether the new `curr` span was
257
- // **originally** the same as the original span of `prev()`. The original spans
258
- // reflect their original sort order, and for equal spans, conveys a partial
259
- // ordering based on CFG dominator priority.
260
- if prev. visible_macro . is_some ( ) && curr. visible_macro . is_some ( ) {
261
- // Macros that expand to include branching (such as
262
- // `assert_eq!()`, `assert_ne!()`, `info!()`, `debug!()`, or
263
- // `trace!()`) typically generate callee spans with identical
264
- // ranges (typically the full span of the macro) for all
265
- // `BasicBlocks`. This makes it impossible to distinguish
266
- // the condition (`if val1 != val2`) from the optional
267
- // branched statements (such as the call to `panic!()` on
268
- // assert failure). In this case it is better (or less
269
- // worse) to drop the optional branch bcbs and keep the
270
- // non-conditional statements, to count when reached.
271
- debug ! (
272
- " curr and prev are part of a macro expansion, and curr has the same span \
273
- as prev, but is in a different bcb. Drop curr and keep prev for next iter. \
274
- prev={prev:?}",
275
- ) ;
276
- self . take_curr ( ) ; // Discards curr.
277
- } else {
278
- self . update_pending_dups ( ) ;
279
- }
254
+ // `prev` and `curr` have the same span, or would have had the
255
+ // same span before `prev` was modified by other spans.
256
+ self . update_pending_dups ( ) ;
280
257
} else {
281
258
self . cutoff_prev_at_overlapping_curr ( ) ;
282
259
self . maybe_push_macro_name_span ( ) ;
0 commit comments