From 63bb9519142aca454aff01aad4fc3c1cafc3128c Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Fri, 26 Aug 2022 12:18:26 -0400 Subject: [PATCH] revert mir inlining policy for beta-1.64 to resolve issue #101004. --- compiler/rustc_mir_transform/src/inline.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/compiler/rustc_mir_transform/src/inline.rs b/compiler/rustc_mir_transform/src/inline.rs index 1e46b0a0e8164..76b1522f394f0 100644 --- a/compiler/rustc_mir_transform/src/inline.rs +++ b/compiler/rustc_mir_transform/src/inline.rs @@ -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; @@ -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>) {