@@ -316,15 +316,13 @@ impl<'a, 'tcx> Instrumentor<'a, 'tcx> {
316316
317317 inject_statement (
318318 self . mir_body ,
319- CoverageKind :: Mappings { term : counter_kind. as_term ( ) } ,
319+ CoverageKind :: Mappings { term : counter_kind. as_term ( ) , code_regions } ,
320320 mir:: START_BLOCK ,
321- code_regions,
322321 ) ;
323322 inject_statement (
324323 self . mir_body ,
325324 self . make_mir_coverage_kind ( & counter_kind) ,
326325 self . bcb_leader_bb ( bcb) ,
327- Vec :: new ( ) ,
328326 ) ;
329327 }
330328 }
@@ -407,7 +405,6 @@ impl<'a, 'tcx> Instrumentor<'a, 'tcx> {
407405 self . mir_body ,
408406 self . make_mir_coverage_kind ( & counter_kind) ,
409407 inject_to_bb,
410- Vec :: new ( ) ,
411408 ) ;
412409 }
413410 BcbCounter :: Expression { .. } => inject_intermediate_expression (
@@ -473,18 +470,13 @@ fn inject_edge_counter_basic_block(
473470 new_bb
474471}
475472
476- fn inject_statement (
477- mir_body : & mut mir:: Body < ' _ > ,
478- counter_kind : CoverageKind ,
479- bb : BasicBlock ,
480- code_regions : Vec < CodeRegion > ,
481- ) {
482- debug ! ( " injecting statement {counter_kind:?} for {bb:?} at code regions: {code_regions:?}" ) ;
473+ fn inject_statement ( mir_body : & mut mir:: Body < ' _ > , counter_kind : CoverageKind , bb : BasicBlock ) {
474+ debug ! ( " injecting statement {counter_kind:?} for {bb:?}" ) ;
483475 let data = & mut mir_body[ bb] ;
484476 let source_info = data. terminator ( ) . source_info ;
485477 let statement = Statement {
486478 source_info,
487- kind : StatementKind :: Coverage ( Box :: new ( Coverage { kind : counter_kind, code_regions } ) ) ,
479+ kind : StatementKind :: Coverage ( Box :: new ( Coverage { kind : counter_kind } ) ) ,
488480 } ;
489481 data. statements . insert ( 0 , statement) ;
490482}
@@ -498,10 +490,7 @@ fn inject_intermediate_expression(mir_body: &mut mir::Body<'_>, expression: Cove
498490 let source_info = data. terminator ( ) . source_info ;
499491 let statement = Statement {
500492 source_info,
501- kind : StatementKind :: Coverage ( Box :: new ( Coverage {
502- kind : expression,
503- code_regions : Vec :: new ( ) ,
504- } ) ) ,
493+ kind : StatementKind :: Coverage ( Box :: new ( Coverage { kind : expression } ) ) ,
505494 } ;
506495 data. statements . push ( statement) ;
507496}
0 commit comments