@@ -290,12 +290,12 @@ impl<'a> CoverageSpansGenerator<'a> {
290
290
while self . next_coverage_span ( ) {
291
291
if self . some_prev . is_none ( ) {
292
292
debug ! ( " initial span" ) ;
293
- self . check_invoked_macro_name_span ( ) ;
293
+ self . maybe_push_macro_name_span ( ) ;
294
294
} else if self . curr ( ) . is_mergeable ( self . prev ( ) ) {
295
295
debug ! ( " same bcb (and neither is a closure), merge with prev={:?}" , self . prev( ) ) ;
296
296
let prev = self . take_prev ( ) ;
297
297
self . curr_mut ( ) . merge_from ( prev) ;
298
- self . check_invoked_macro_name_span ( ) ;
298
+ self . maybe_push_macro_name_span ( ) ;
299
299
// Note that curr.span may now differ from curr_original_span
300
300
} else if self . prev_ends_before_curr ( ) {
301
301
debug ! (
@@ -305,7 +305,7 @@ impl<'a> CoverageSpansGenerator<'a> {
305
305
) ;
306
306
let prev = self . take_prev ( ) ;
307
307
self . push_refined_span ( prev) ;
308
- self . check_invoked_macro_name_span ( ) ;
308
+ self . maybe_push_macro_name_span ( ) ;
309
309
} else if self . prev ( ) . is_closure {
310
310
// drop any equal or overlapping span (`curr`) and keep `prev` to test again in the
311
311
// next iter
@@ -347,7 +347,7 @@ impl<'a> CoverageSpansGenerator<'a> {
347
347
}
348
348
} else {
349
349
self . cutoff_prev_at_overlapping_curr ( ) ;
350
- self . check_invoked_macro_name_span ( ) ;
350
+ self . maybe_push_macro_name_span ( ) ;
351
351
}
352
352
}
353
353
@@ -399,7 +399,9 @@ impl<'a> CoverageSpansGenerator<'a> {
399
399
self . refined_spans . push ( covspan)
400
400
}
401
401
402
- fn check_invoked_macro_name_span ( & mut self ) {
402
+ /// If `curr` is part of a new macro expansion, carve out and push a separate
403
+ /// span that ends just after the macro name and its subsequent `!`.
404
+ fn maybe_push_macro_name_span ( & mut self ) {
403
405
if let Some ( visible_macro) = self . curr ( ) . visible_macro ( self . body_span ) {
404
406
if !self
405
407
. prev_expn_span
0 commit comments