Skip to content

Commit af0a464

Browse files
committed
Gracefully handle normalization failures in the prospective inliner cycle detector
1 parent 3a08bd7 commit af0a464

File tree

1 file changed

+4
-1
lines changed
  • compiler/rustc_mir_transform/src/inline

1 file changed

+4
-1
lines changed

compiler/rustc_mir_transform/src/inline/cycle.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ crate fn mir_callgraph_reachable<'tcx>(
4545
) -> bool {
4646
trace!(%caller);
4747
for &(callee, substs) in tcx.mir_inliner_callees(caller.def) {
48-
let substs = caller.subst_mir_and_normalize_erasing_regions(tcx, param_env, substs);
48+
let Ok(substs) = caller.try_subst_mir_and_normalize_erasing_regions(tcx, param_env, substs) else {
49+
trace!(?caller, ?param_env, ?substs, "cannot normalize, skipping");
50+
continue;
51+
};
4952
let Some(callee) = ty::Instance::resolve(tcx, param_env, callee, substs).unwrap() else {
5053
trace!(?callee, "cannot resolve, skipping");
5154
continue;

0 commit comments

Comments
 (0)