@@ -290,12 +290,12 @@ impl<'a> CoverageSpansGenerator<'a> {
290290 while self . next_coverage_span ( ) {
291291 if self . some_prev . is_none ( ) {
292292 debug ! ( " initial span" ) ;
293- self . check_invoked_macro_name_span ( ) ;
293+ self . maybe_push_macro_name_span ( ) ;
294294 } else if self . curr ( ) . is_mergeable ( self . prev ( ) ) {
295295 debug ! ( " same bcb (and neither is a closure), merge with prev={:?}" , self . prev( ) ) ;
296296 let prev = self . take_prev ( ) ;
297297 self . curr_mut ( ) . merge_from ( prev) ;
298- self . check_invoked_macro_name_span ( ) ;
298+ self . maybe_push_macro_name_span ( ) ;
299299 // Note that curr.span may now differ from curr_original_span
300300 } else if self . prev_ends_before_curr ( ) {
301301 debug ! (
@@ -305,7 +305,7 @@ impl<'a> CoverageSpansGenerator<'a> {
305305 ) ;
306306 let prev = self . take_prev ( ) ;
307307 self . push_refined_span ( prev) ;
308- self . check_invoked_macro_name_span ( ) ;
308+ self . maybe_push_macro_name_span ( ) ;
309309 } else if self . prev ( ) . is_closure {
310310 // drop any equal or overlapping span (`curr`) and keep `prev` to test again in the
311311 // next iter
@@ -347,7 +347,7 @@ impl<'a> CoverageSpansGenerator<'a> {
347347 }
348348 } else {
349349 self . cutoff_prev_at_overlapping_curr ( ) ;
350- self . check_invoked_macro_name_span ( ) ;
350+ self . maybe_push_macro_name_span ( ) ;
351351 }
352352 }
353353
@@ -399,7 +399,9 @@ impl<'a> CoverageSpansGenerator<'a> {
399399 self . refined_spans . push ( covspan)
400400 }
401401
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 ) {
403405 if let Some ( visible_macro) = self . curr ( ) . visible_macro ( self . body_span ) {
404406 if !self
405407 . prev_expn_span
0 commit comments