about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/inline
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_mir_transform/src/inline')
-rw-r--r--compiler/rustc_mir_transform/src/inline/cycle.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_mir_transform/src/inline/cycle.rs b/compiler/rustc_mir_transform/src/inline/cycle.rs
index ea1ec6249bc..95e8875c203 100644
--- a/compiler/rustc_mir_transform/src/inline/cycle.rs
+++ b/compiler/rustc_mir_transform/src/inline/cycle.rs
@@ -45,7 +45,10 @@ crate fn mir_callgraph_reachable<'tcx>(
     ) -> bool {
         trace!(%caller);
         for &(callee, substs) in tcx.mir_inliner_callees(caller.def) {
-            let substs = caller.subst_mir_and_normalize_erasing_regions(tcx, param_env, substs);
+            let Ok(substs) = caller.try_subst_mir_and_normalize_erasing_regions(tcx, param_env, substs) else {
+                trace!(?caller, ?param_env, ?substs, "cannot normalize, skipping");
+                continue;
+            };
             let Some(callee) = ty::Instance::resolve(tcx, param_env, callee, substs).unwrap() else {
                 trace!(?callee, "cannot resolve, skipping");
                 continue;