Fix FnOnce impl for AsyncFn/AsyncFnMut closures in new solver

This commit is contained in:
Michael Goulet
2025-05-21 18:07:29 +00:00
parent ca912d794d
commit e0f8055871
2 changed files with 16 additions and 1 deletions

View File

@@ -327,7 +327,7 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_callable<I: Intern
// always be called once. It additionally implements `Fn`/`FnMut`
// only if it has no upvars referencing the closure-env lifetime,
// and if the closure kind permits it.
if closure_kind != ty::ClosureKind::FnOnce && args.has_self_borrows() {
if goal_kind != ty::ClosureKind::FnOnce && args.has_self_borrows() {
return Err(NoSolution);
}