Skip to content

Commit 63bb951

Browse files
committed
revert mir inlining policy for beta-1.64 to resolve issue rust-lang#101004.
1 parent 82bf341 commit 63bb951

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

compiler/rustc_mir_transform/src/inline.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use rustc_middle::mir::visit::*;
99
use rustc_middle::mir::*;
1010
use rustc_middle::ty::subst::Subst;
1111
use rustc_middle::ty::{self, ConstKind, Instance, InstanceDef, ParamEnv, Ty, TyCtxt};
12-
use rustc_session::config::OptLevel;
1312
use rustc_span::{hygiene::ExpnKind, ExpnData, LocalExpnId, Span};
1413
use rustc_target::spec::abi::Abi;
1514

@@ -44,15 +43,8 @@ impl<'tcx> MirPass<'tcx> for Inline {
4443
return enabled;
4544
}
4645

47-
match sess.mir_opt_level() {
48-
0 | 1 => false,
49-
2 => {
50-
(sess.opts.optimize == OptLevel::Default
51-
|| sess.opts.optimize == OptLevel::Aggressive)
52-
&& sess.opts.incremental == None
53-
}
54-
_ => true,
55-
}
46+
// rust-lang/rust#101004: reverted to old inlining decision logic
47+
sess.mir_opt_level() >= 3
5648
}
5749

5850
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {

0 commit comments

Comments
 (0)