unconditional recursion, yeet TypingEnv::from_param_env
This commit is contained in:
parent
948cec0fad
commit
1ec964873e
1 changed files with 5 additions and 10 deletions
|
@ -132,21 +132,16 @@ impl<'tcx> TerminatorClassifier<'tcx> for CallRecursion<'tcx> {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
let caller = body.source.def_id();
|
let caller = body.source.def_id();
|
||||||
let param_env = tcx.param_env(caller);
|
let typing_env = body.typing_env(tcx);
|
||||||
|
|
||||||
let func_ty = func.ty(body, tcx);
|
let func_ty = func.ty(body, tcx);
|
||||||
if let ty::FnDef(callee, args) = *func_ty.kind() {
|
if let ty::FnDef(callee, args) = *func_ty.kind() {
|
||||||
let Ok(normalized_args) =
|
let Ok(normalized_args) = tcx.try_normalize_erasing_regions(typing_env, args) else {
|
||||||
tcx.try_normalize_erasing_regions(ty::TypingEnv::from_param_env(param_env), args)
|
|
||||||
else {
|
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
let (callee, call_args) = if let Ok(Some(instance)) = Instance::try_resolve(
|
let (callee, call_args) = if let Ok(Some(instance)) =
|
||||||
tcx,
|
Instance::try_resolve(tcx, typing_env, callee, normalized_args)
|
||||||
ty::TypingEnv::from_param_env(param_env),
|
{
|
||||||
callee,
|
|
||||||
normalized_args,
|
|
||||||
) {
|
|
||||||
(instance.def_id(), instance.args)
|
(instance.def_id(), instance.args)
|
||||||
} else {
|
} else {
|
||||||
(callee, normalized_args)
|
(callee, normalized_args)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue