We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
#[inline(always)]
1 parent df0d9b4 commit 796cafeCopy full SHA for 796cafe
compiler/rustc_mir_transform/src/inline.rs
@@ -48,7 +48,8 @@ impl<'tcx> MirPass<'tcx> for Inline {
48
}
49
50
match sess.mir_opt_level() {
51
- 0 | 1 => false,
+ 0 => false,
52
+ 1 => true,
53
2 => {
54
(sess.opts.optimize == OptLevel::Default
55
|| sess.opts.optimize == OptLevel::Aggressive)
@@ -173,6 +174,10 @@ impl<'tcx> Inliner<'tcx> {
173
174
let callee_body = self.tcx.instance_mir(callsite.callee.def);
175
self.check_mir_body(callsite, callee_body, callee_attrs)?;
176
177
+ if self.tcx.sess.mir_opt_level() == 1 {
178
+ return Err("mir_opt_level == 1");
179
+ }
180
+
181
if !self.tcx.consider_optimizing(|| {
182
format!("Inline {:?} into {:?}", callsite.callee, caller_body.source)
183
}) {
0 commit comments