Gracefully handle normalization failures in the prospective inliner cycle detector
This commit is contained in:
parent
3a08bd7873
commit
af0a464311
1 changed files with 4 additions and 1 deletions
|
@ -45,7 +45,10 @@ crate fn mir_callgraph_reachable<'tcx>(
|
||||||
) -> bool {
|
) -> bool {
|
||||||
trace!(%caller);
|
trace!(%caller);
|
||||||
for &(callee, substs) in tcx.mir_inliner_callees(caller.def) {
|
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 {
|
let Some(callee) = ty::Instance::resolve(tcx, param_env, callee, substs).unwrap() else {
|
||||||
trace!(?callee, "cannot resolve, skipping");
|
trace!(?callee, "cannot resolve, skipping");
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue