Skip to content

Add Async Recursion Macro to Workarounds#85

Closed
zicklag wants to merge 1 commit into
rust-lang:masterfrom
zicklag:patch-1
Closed

Add Async Recursion Macro to Workarounds#85
zicklag wants to merge 1 commit into
rust-lang:masterfrom
zicklag:patch-1

Conversation

@zicklag

@zicklag zicklag commented Mar 27, 2020

Copy link
Copy Markdown

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

taiki-e commented Jul 30, 2022

Copy link
Copy Markdown
Member

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

@zicklag

zicklag commented Jul 30, 2022

Copy link
Copy Markdown
Author

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

@taiki-e

taiki-e commented Jul 30, 2022

Copy link
Copy Markdown
Member

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

@nrc nrc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@nrc

nrc commented Oct 5, 2024

Copy link
Copy Markdown
Member

Given the age of the PR and the conflicts I'm going to close this, sorry it never got merged

@nrc nrc closed this Oct 5, 2024
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.

3 participants