Skip to content

Commit

Permalink
revert mir inlining policy for beta-1.64 to resolve issue rust-lang#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkfelix committed Aug 26, 2022
1 parent 82bf341 commit 63bb951
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions compiler/rustc_mir_transform/src/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use rustc_middle::mir::visit::*;
use rustc_middle::mir::*;
use rustc_middle::ty::subst::Subst;
use rustc_middle::ty::{self, ConstKind, Instance, InstanceDef, ParamEnv, Ty, TyCtxt};
use rustc_session::config::OptLevel;
use rustc_span::{hygiene::ExpnKind, ExpnData, LocalExpnId, Span};
use rustc_target::spec::abi::Abi;

Expand Down Expand Up @@ -44,15 +43,8 @@ impl<'tcx> MirPass<'tcx> for Inline {
return enabled;
}

match sess.mir_opt_level() {
0 | 1 => false,
2 => {
(sess.opts.optimize == OptLevel::Default
|| sess.opts.optimize == OptLevel::Aggressive)
&& sess.opts.incremental == None
}
_ => true,
}
// rust-lang/rust#101004: reverted to old inlining decision logic
sess.mir_opt_level() >= 3
}

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

0 comments on commit 63bb951

Please sign in to comment.