@@ -12,7 +12,7 @@ use rustc_middle::ty::{self, ConstKind, Instance, InstanceDef, ParamEnv, Ty, TyC
12
12
use rustc_target:: spec:: abi:: Abi ;
13
13
14
14
use super :: simplify:: { remove_dead_blocks, CfgSimplifier } ;
15
- use crate :: transform:: MirPass ;
15
+ use crate :: transform:: { MirPass , OptLevel } ;
16
16
use std:: collections:: VecDeque ;
17
17
use std:: iter;
18
18
@@ -37,21 +37,21 @@ struct CallSite<'tcx> {
37
37
}
38
38
39
39
impl < ' tcx > MirPass < ' tcx > for Inline {
40
+ const LEVEL : OptLevel = OptLevel :: N ( 2 ) ;
41
+
40
42
fn run_pass ( & self , tcx : TyCtxt < ' tcx > , body : & mut Body < ' tcx > ) {
41
- if tcx. sess . opts . debugging_opts . mir_opt_level >= 2 {
42
- if tcx. sess . opts . debugging_opts . instrument_coverage {
43
- // The current implementation of source code coverage injects code region counters
44
- // into the MIR, and assumes a 1-to-1 correspondence between MIR and source-code-
45
- // based function.
46
- debug ! ( "function inlining is disabled when compiling with `instrument_coverage`" ) ;
47
- } else {
48
- Inliner {
49
- tcx,
50
- param_env : tcx. param_env_reveal_all_normalized ( body. source . def_id ( ) ) ,
51
- codegen_fn_attrs : tcx. codegen_fn_attrs ( body. source . def_id ( ) ) ,
52
- }
53
- . run_pass ( body) ;
43
+ if tcx. sess . opts . debugging_opts . instrument_coverage {
44
+ // The current implementation of source code coverage injects code region counters
45
+ // into the MIR, and assumes a 1-to-1 correspondence between MIR and source-code-
46
+ // based function.
47
+ debug ! ( "function inlining is disabled when compiling with `instrument_coverage`" ) ;
48
+ } else {
49
+ Inliner {
50
+ tcx,
51
+ param_env : tcx. param_env_reveal_all_normalized ( body. source . def_id ( ) ) ,
52
+ codegen_fn_attrs : tcx. codegen_fn_attrs ( body. source . def_id ( ) ) ,
54
53
}
54
+ . run_pass ( body) ;
55
55
}
56
56
}
57
57
}
0 commit comments