@@ -396,27 +396,25 @@ impl<'a> CoverageSpansGenerator<'a> {
396
396
}
397
397
398
398
fn check_invoked_macro_name_span ( & mut self ) {
399
- if let Some ( visible_macro) = self . curr ( ) . visible_macro ( self . body_span ) {
400
- if !self
401
- . prev_expn_span
402
- . is_some_and ( |prev_expn_span| self . curr ( ) . expn_span . ctxt ( ) == prev_expn_span. ctxt ( ) )
403
- {
404
- let merged_prefix_len = self . curr_original_span . lo ( ) - self . curr ( ) . span . lo ( ) ;
405
- let after_macro_bang =
406
- merged_prefix_len + BytePos ( visible_macro. as_str ( ) . len ( ) as u32 + 1 ) ;
407
- let mut macro_name_cov = self . curr ( ) . clone ( ) ;
408
- self . curr_mut ( ) . span =
409
- self . curr ( ) . span . with_lo ( self . curr ( ) . span . lo ( ) + after_macro_bang) ;
410
- macro_name_cov. span =
411
- macro_name_cov. span . with_hi ( macro_name_cov. span . lo ( ) + after_macro_bang) ;
412
- debug ! (
413
- " and curr starts a new macro expansion, so add a new span just for \
414
- the macro `{}!`, new span={:?}",
415
- visible_macro, macro_name_cov
416
- ) ;
417
- self . push_refined_span ( macro_name_cov) ;
418
- }
399
+ let Some ( visible_macro) = self . curr ( ) . visible_macro ( self . body_span ) else { return } ;
400
+ if let Some ( prev_expn_span) = & self . prev_expn_span
401
+ && prev_expn_span. ctxt ( ) == self . curr ( ) . expn_span . ctxt ( )
402
+ {
403
+ return ;
419
404
}
405
+
406
+ let merged_prefix_len = self . curr_original_span . lo ( ) - self . curr ( ) . span . lo ( ) ;
407
+ let after_macro_bang = merged_prefix_len + BytePos ( visible_macro. as_str ( ) . len ( ) as u32 + 1 ) ;
408
+ let mut macro_name_cov = self . curr ( ) . clone ( ) ;
409
+ self . curr_mut ( ) . span = self . curr ( ) . span . with_lo ( self . curr ( ) . span . lo ( ) + after_macro_bang) ;
410
+ macro_name_cov. span =
411
+ macro_name_cov. span . with_hi ( macro_name_cov. span . lo ( ) + after_macro_bang) ;
412
+ debug ! (
413
+ " and curr starts a new macro expansion, so add a new span just for \
414
+ the macro `{}!`, new span={:?}",
415
+ visible_macro, macro_name_cov
416
+ ) ;
417
+ self . push_refined_span ( macro_name_cov) ;
420
418
}
421
419
422
420
fn curr ( & self ) -> & CoverageSpan {
0 commit comments