1
Fork 0

Rollup merge of #121181 - oli-obk:normalize_with_conflicting_impls, r=cjgillot

Fix an ICE in the recursion lint

fixes #121170

I looked into it, and there is no good path towards tainting mir_build (where the ICE happens), but using `try_normalize` in a lint seems generally better anyway
This commit is contained in:
Guillaume Gomez 2024-02-16 17:08:14 +01:00 committed by GitHub
commit f82875e242
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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)
{