Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Async Recursion Macro to Workarounds #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zicklag
Copy link

@zicklag zicklag commented Mar 27, 2020

This may not be something you want in the book, but there is a nifty macro crate for automatically transforming async functions to return boxed futures that could be useful to people.

I noticed the other example was in a separate file, but this is a super small example so I just inlined it. I can change it if you like.

@taiki-e
Copy link
Member

taiki-e commented Jul 30, 2022

I wonder if this is no longer necessary because impl trait recursion was allowed some time ago.

@zicklag
Copy link
Author

zicklag commented Jul 30, 2022

Looks like a simple recursive async function still fails ( playground ).

@taiki-e
Copy link
Member

taiki-e commented Jul 30, 2022

Ah, thanks. And it is impressive that the compiler's diagnosis mentions async_recursion crate.

  = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants