1
Fork 0

Lower return types for gen fn to impl Iterator

This commit is contained in:
Eric Holk 2023-11-29 12:07:43 -08:00
parent bc0d10d4b0
commit c104f3b629
No known key found for this signature in database
GPG key ID: 8EA6B43ED4CE0911
7 changed files with 167 additions and 80 deletions

View file

@ -156,7 +156,10 @@ impl<'a, 'b, 'tcx> visit::Visitor<'a> for DefCollector<'a, 'b, 'tcx> {
fn visit_fn(&mut self, fn_kind: FnKind<'a>, span: Span, _: NodeId) {
if let FnKind::Fn(_, _, sig, _, generics, body) = fn_kind {
if let Async::Yes { closure_id, .. } = sig.header.asyncness {
// FIXME(eholk): handle `async gen fn`
if let (Async::Yes { closure_id, .. }, _) | (_, Gen::Yes { closure_id, .. }) =
(sig.header.asyncness, sig.header.genness)
{
self.visit_generics(generics);
// For async functions, we need to create their inner defs inside of a