From 8348d21b9264c1cebea204d3c9c00da62b2746dc Mon Sep 17 00:00:00 2001 From: Sebastien Tardif Date: Tue, 23 Jun 2026 22:32:37 -0700 Subject: [PATCH] hir_analysis: collect CoroutineClosure in OpaqueTypeCollector Async closures can embed opaque types in their signatures and upvars. Walk CoroutineClosure like Closure/Coroutine so nested opaques are found. Signed-off-by: Sebastien Tardif --- compiler/rustc_hir_analysis/src/check/check.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_hir_analysis/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs index 917360ab8119e..3208602fd4900 100644 --- a/compiler/rustc_hir_analysis/src/check/check.rs +++ b/compiler/rustc_hir_analysis/src/check/check.rs @@ -2194,7 +2194,9 @@ fn opaque_type_cycle_error(tcx: TyCtxt<'_>, opaque_def_id: LocalDefId) -> ErrorG ty::Alias(ty::AliasTy { kind: ty::Opaque { def_id: def }, .. }) => { self.opaques.push(def); } - ty::Closure(def_id, ..) | ty::Coroutine(def_id, ..) => { + ty::Closure(def_id, ..) + | ty::CoroutineClosure(def_id, ..) + | ty::Coroutine(def_id, ..) => { self.closures.push(def_id); t.super_visit_with(self); }