1
Fork 0

Fix an ICE in the recursion lint

This commit is contained in:
Oli Scherer 2024-02-16 09:29:39 +00:00
parent 0f806a9812
commit db4ba498d9
3 changed files with 73 additions and 1 deletions

View file

@ -137,7 +137,9 @@ impl<'tcx> TerminatorClassifier<'tcx> for CallRecursion<'tcx> {
let func_ty = func.ty(body, tcx);
if let ty::FnDef(callee, args) = *func_ty.kind() {
let normalized_args = tcx.normalize_erasing_regions(param_env, args);
let Ok(normalized_args) = tcx.try_normalize_erasing_regions(param_env, args) else {
return false;
};
let (callee, call_args) = if let Ok(Some(instance)) =
Instance::resolve(tcx, param_env, callee, normalized_args)
{