@@ -316,15 +316,13 @@ impl<'a, 'tcx> Instrumentor<'a, 'tcx> {
316
316
317
317
inject_statement (
318
318
self . mir_body ,
319
- CoverageKind :: Mappings { term : counter_kind. as_term ( ) } ,
319
+ CoverageKind :: Mappings { term : counter_kind. as_term ( ) , code_regions } ,
320
320
mir:: START_BLOCK ,
321
- code_regions,
322
321
) ;
323
322
inject_statement (
324
323
self . mir_body ,
325
324
self . make_mir_coverage_kind ( & counter_kind) ,
326
325
self . bcb_leader_bb ( bcb) ,
327
- Vec :: new ( ) ,
328
326
) ;
329
327
}
330
328
}
@@ -407,7 +405,6 @@ impl<'a, 'tcx> Instrumentor<'a, 'tcx> {
407
405
self . mir_body ,
408
406
self . make_mir_coverage_kind ( & counter_kind) ,
409
407
inject_to_bb,
410
- Vec :: new ( ) ,
411
408
) ;
412
409
}
413
410
BcbCounter :: Expression { .. } => inject_intermediate_expression (
@@ -473,18 +470,13 @@ fn inject_edge_counter_basic_block(
473
470
new_bb
474
471
}
475
472
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:?}" ) ;
483
475
let data = & mut mir_body[ bb] ;
484
476
let source_info = data. terminator ( ) . source_info ;
485
477
let statement = Statement {
486
478
source_info,
487
- kind : StatementKind :: Coverage ( Box :: new ( Coverage { kind : counter_kind, code_regions } ) ) ,
479
+ kind : StatementKind :: Coverage ( Box :: new ( Coverage { kind : counter_kind } ) ) ,
488
480
} ;
489
481
data. statements . insert ( 0 , statement) ;
490
482
}
@@ -498,10 +490,7 @@ fn inject_intermediate_expression(mir_body: &mut mir::Body<'_>, expression: Cove
498
490
let source_info = data. terminator ( ) . source_info ;
499
491
let statement = Statement {
500
492
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 } ) ) ,
505
494
} ;
506
495
data. statements . push ( statement) ;
507
496
}
0 commit comments