summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_mir_transform/src/inline
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /compiler/rustc_mir_transform/src/inline
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_mir_transform/src/inline')
-rw-r--r--compiler/rustc_mir_transform/src/inline/cycle.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/compiler/rustc_mir_transform/src/inline/cycle.rs b/compiler/rustc_mir_transform/src/inline/cycle.rs
index 8aa3c23d0..1ccf06f61 100644
--- a/compiler/rustc_mir_transform/src/inline/cycle.rs
+++ b/compiler/rustc_mir_transform/src/inline/cycle.rs
@@ -13,7 +13,7 @@ pub(crate) fn mir_callgraph_reachable<'tcx>(
tcx: TyCtxt<'tcx>,
(root, target): (ty::Instance<'tcx>, LocalDefId),
) -> bool {
- trace!(%root, target = %tcx.def_path_str(target.to_def_id()));
+ trace!(%root, target = %tcx.def_path_str(target));
let param_env = tcx.param_env_reveal_all_normalized(target);
assert_ne!(
root.def_id().expect_local(),
@@ -44,7 +44,11 @@ pub(crate) fn mir_callgraph_reachable<'tcx>(
) -> bool {
trace!(%caller);
for &(callee, substs) in tcx.mir_inliner_callees(caller.def) {
- let Ok(substs) = caller.try_subst_mir_and_normalize_erasing_regions(tcx, param_env, substs) else {
+ let Ok(substs) = caller.try_subst_mir_and_normalize_erasing_regions(
+ tcx,
+ param_env,
+ ty::EarlyBinder(substs),
+ ) else {
trace!(?caller, ?param_env, ?substs, "cannot normalize, skipping");
continue;
};
@@ -92,7 +96,7 @@ pub(crate) fn mir_callgraph_reachable<'tcx>(
// FIXME: A not fully substituted drop shim can cause ICEs if one attempts to
// have its MIR built. Likely oli-obk just screwed up the `ParamEnv`s, so this
// needs some more analysis.
- if callee.needs_subst() {
+ if callee.has_param() {
continue;
}
}
@@ -148,8 +152,7 @@ pub(crate) fn mir_inliner_callees<'tcx>(
let guard;
let body = match (instance, instance.def_id().as_local()) {
(InstanceDef::Item(_), Some(def_id)) => {
- let def = ty::WithOptConstParam::unknown(def_id);
- steal = tcx.mir_promoted(def).0;
+ steal = tcx.mir_promoted(def_id).0;
guard = steal.borrow();
&*guard
}