File tree 1 file changed +10
-1
lines changed
compiler/rustc_mir_transform/src/coverage
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ use counters::CoverageCounters;
12
12
use graph:: { BasicCoverageBlock , BasicCoverageBlockData , CoverageGraph } ;
13
13
use spans:: { CoverageSpan , CoverageSpans } ;
14
14
15
- use crate :: MirPass ;
15
+ use crate :: pass_manager:: { Flag , Constraint , constraints:: * } ;
16
+ use crate :: { MirPass , MirPassC } ;
16
17
17
18
use rustc_data_structures:: graph:: WithNumNodes ;
18
19
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
@@ -48,6 +49,14 @@ impl Error {
48
49
/// to construct the coverage map.
49
50
pub struct InstrumentCoverage ;
50
51
52
+ impl MirPassC for InstrumentCoverage {
53
+ const FLAGS : & ' static [ Flag ] = & [ Flag :: InstrumentCoverage ] ;
54
+ const CONSTRAINTS : & ' static [ Constraint ] = & [
55
+ // Promoteds run at compile-time, so they don't have meaningful coverage information.
56
+ after :: < super :: promote_consts:: PromoteTemps > ( ) ,
57
+ ] ;
58
+ }
59
+
51
60
impl < ' tcx > MirPass < ' tcx > for InstrumentCoverage {
52
61
fn run_pass ( & self , tcx : TyCtxt < ' tcx > , mir_body : & mut mir:: Body < ' tcx > ) {
53
62
let mir_source = mir_body. source ;
You can’t perform that action at this time.
0 commit comments