@@ -288,7 +288,7 @@ impl<'a> CoverageSpansGenerator<'a> {
288
288
// span-processing steps don't make sense yet.
289
289
if self . some_prev . is_none ( ) {
290
290
debug ! ( " initial span" ) ;
291
- self . check_invoked_macro_name_span ( ) ;
291
+ self . maybe_push_macro_name_span ( ) ;
292
292
continue ;
293
293
}
294
294
@@ -300,15 +300,15 @@ impl<'a> CoverageSpansGenerator<'a> {
300
300
debug ! ( " same bcb (and neither is a closure), merge with prev={prev:?}" ) ;
301
301
let prev = self . take_prev ( ) ;
302
302
self . curr_mut ( ) . merge_from ( prev) ;
303
- self . check_invoked_macro_name_span ( ) ;
303
+ self . maybe_push_macro_name_span ( ) ;
304
304
// Note that curr.span may now differ from curr_original_span
305
305
} else if prev. span . hi ( ) <= curr. span . lo ( ) {
306
306
debug ! (
307
307
" different bcbs and disjoint spans, so keep curr for next iter, and add prev={prev:?}" ,
308
308
) ;
309
309
let prev = self . take_prev ( ) ;
310
310
self . push_refined_span ( prev) ;
311
- self . check_invoked_macro_name_span ( ) ;
311
+ self . maybe_push_macro_name_span ( ) ;
312
312
} else if prev. is_closure {
313
313
// drop any equal or overlapping span (`curr`) and keep `prev` to test again in the
314
314
// 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
@@ -395,7 +395,9 @@ impl<'a> CoverageSpansGenerator<'a> {
395
395
}
396
396
}
397
397
398
- fn check_invoked_macro_name_span ( & mut self ) {
398
+ /// If `curr` is part of a new macro expansion, carve out and push a separate
399
+ /// span that ends just after the macro name and its subsequent `!`.
400
+ fn maybe_push_macro_name_span ( & mut self ) {
399
401
let curr = self . curr ( ) ;
400
402
401
403
let Some ( visible_macro) = curr. visible_macro ( self . body_span ) else { return } ;
0 commit comments