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