Bug
closure_span_overlaps_error in compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs:489 matches ty::Closure(def_id, _) | ty::Coroutine(def_id, ..) but is missing ty::CoroutineClosure(def_id, ..).
When an async closure has a signature mismatch error and the closure span overlaps the error span, this function fails to recognize the CoroutineClosure type variant. It returns false instead of true, causing the fulfillment error adjustment logic to skip the async closure. This can lead to less precise error messages for async closure signature mismatches.
Code at fault
// adjust_fulfillment_errors.rs:489
ty::Closure(def_id, _) | ty::Coroutine(def_id, ..) =>
expected_trait_ref.self_ty().kind()
Missing: ty::CoroutineClosure(def_id, ..)
Pattern
Same CoroutineClosure-missing-from-match pattern as #477, #478, #479, #483. The CoroutineClosure TyKind variant was added for async closures but many match sites were not updated.
Severity
Diagnostic-only. Affects error message quality for async closure signature mismatches, not correctness of compilation.
Bug
closure_span_overlaps_errorincompiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs:489matchesty::Closure(def_id, _) | ty::Coroutine(def_id, ..)but is missingty::CoroutineClosure(def_id, ..).When an async closure has a signature mismatch error and the closure span overlaps the error span, this function fails to recognize the
CoroutineClosuretype variant. It returnsfalseinstead oftrue, causing the fulfillment error adjustment logic to skip the async closure. This can lead to less precise error messages for async closure signature mismatches.Code at fault
Missing:
ty::CoroutineClosure(def_id, ..)Pattern
Same CoroutineClosure-missing-from-match pattern as #477, #478, #479, #483. The
CoroutineClosureTyKind variant was added for async closures but many match sites were not updated.Severity
Diagnostic-only. Affects error message quality for async closure signature mismatches, not correctness of compilation.