Bug
Multiple diagnostic and lint code paths match ty::Closure and/or ty::Coroutine but miss ty::CoroutineClosure, producing less precise error messages or lint false negatives for async closures.
Affected locations
| File |
Line |
Impact |
rustc_borrowck/src/diagnostics/explain_borrow.rs |
213 |
Shows raw type instead of "closure" for async closure destructors |
rustc_borrowck/src/diagnostics/region_errors.rs |
182 |
is_closure_fn_mut returns false for async FnMut closures, causing less specific region error |
rustc_lint/src/dangling.rs |
105 |
DANGLING_POINTERS_FROM_LOCALS lint silently skips async closures |
rustc_hir_analysis/src/hir_ty_lowering/errors.rs |
973 |
Missing "point at closure" span for async closure trait bound failures |
rustc_hir_typeck/src/fn_ctxt/checks.rs |
1400, 1628 |
Missing "callable defined here" note and call-site matching for async closures |
rustc_hir_typeck/src/method/suggest.rs |
1827 |
Missing "point at closure" span in method resolution errors (same pattern as hir_ty_lowering) |
rustc_trait_selection/src/error_reporting/infer/mod.rs |
1782, 1850, 2556 |
Missing "closure has signature" note, missing "does not fulfill lifetime" suggestion, and missing TyCategory for async closures |
Pattern
Same CoroutineClosure-missing-from-match pattern found across Rounds 63-64. Each is a one-line addition of ty::CoroutineClosure(..) to an existing match arm.
Severity
All P-low, diagnostic/lint quality only. No ICEs or wrong codegen. The most impactful is the dangling.rs lint false negative, which silently skips async closures returning dangling pointers.
Bug
Multiple diagnostic and lint code paths match
ty::Closureand/orty::Coroutinebut missty::CoroutineClosure, producing less precise error messages or lint false negatives for async closures.Affected locations
rustc_borrowck/src/diagnostics/explain_borrow.rsrustc_borrowck/src/diagnostics/region_errors.rsis_closure_fn_mutreturns false for async FnMut closures, causing less specific region errorrustc_lint/src/dangling.rsDANGLING_POINTERS_FROM_LOCALSlint silently skips async closuresrustc_hir_analysis/src/hir_ty_lowering/errors.rsrustc_hir_typeck/src/fn_ctxt/checks.rsrustc_hir_typeck/src/method/suggest.rsrustc_trait_selection/src/error_reporting/infer/mod.rsPattern
Same CoroutineClosure-missing-from-match pattern found across Rounds 63-64. Each is a one-line addition of
ty::CoroutineClosure(..)to an existing match arm.Severity
All P-low, diagnostic/lint quality only. No ICEs or wrong codegen. The most impactful is the
dangling.rslint false negative, which silently skips async closures returning dangling pointers.