diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-06-29 07:52:45 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-07-07 13:17:00 +0000 |
| commit | b549ba1bd4313990d164bc7152e61aefd68eeacd (patch) | |
| tree | 8083bddb20bead7792218e9c79871d7206e7a4c1 /compiler/rustc_ty_utils/src | |
| parent | ef52dc7bb8c14c5663773f70e1353fd53131261c (diff) | |
| download | rust-b549ba1bd4313990d164bc7152e61aefd68eeacd.tar.gz rust-b549ba1bd4313990d164bc7152e61aefd68eeacd.zip | |
Fix one layer of closures not being able to constrain opaque types
Diffstat (limited to 'compiler/rustc_ty_utils/src')
| -rw-r--r-- | compiler/rustc_ty_utils/src/opaque_types.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_ty_utils/src/opaque_types.rs b/compiler/rustc_ty_utils/src/opaque_types.rs index 2a706d72843..40d61f47adb 100644 --- a/compiler/rustc_ty_utils/src/opaque_types.rs +++ b/compiler/rustc_ty_utils/src/opaque_types.rs @@ -322,7 +322,10 @@ fn opaque_types_defined_by<'tcx>(tcx: TyCtxt<'tcx>, item: LocalDefId) -> &'tcx [ | DefKind::GlobalAsm | DefKind::Impl { .. } => {} DefKind::Closure | DefKind::Generator => { - return tcx.opaque_types_defined_by(tcx.local_parent(item)); + // All items in the signature of the parent are ok + collector.opaques.extend(tcx.opaque_types_defined_by(tcx.local_parent(item))); + // And items in the body of the closure itself + collector.collect_taits_declared_in_body(); } } tcx.arena.alloc_from_iter(collector.opaques) |
