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