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

Can not use async block or async fn in async_std::future::select!. #387

Closed
oblique opened this issue Oct 24, 2019 · 5 comments · Fixed by #405
Closed

Can not use async block or async fn in async_std::future::select!. #387

oblique opened this issue Oct 24, 2019 · 5 comments · Fixed by #405
Labels
question/feedback A question or user feedback

Comments

@oblique
Copy link

oblique commented Oct 24, 2019

I would expect this to work:

async fn foo() {
}

async_std::future::select!(foo(), async { });
@skade
Copy link
Collaborator

skade commented Oct 28, 2019

I see your point. The select macro is sadly limited by virtue of being a plain macro, let's see if we can fix this somehow.

I'd like to avoid using proc_macro_hack like futures does for this.

@k-nasa
Copy link
Member

k-nasa commented Oct 28, 2019

The same is true for join macros.
I thought the same thing, so I am very interested in how this is solved.

@yoshuawuyts
Copy link
Contributor

What we've been talking about for a while now is to change the select! macros into regular methods. Unlike join! they don't have polymorphic output, which means it's mostly about maintaining parity with join. And to me that's started to become less appealing as an argument recently.

@paulocsanz
Copy link
Contributor

Proc-macros compiled to web-assembly can help with this too without significant costs.

https://github.com/dtolnay/watt

@skade
Copy link
Collaborator

skade commented Oct 31, 2019

@paulocsanz Yes, but this is also heavily experimental and as such a compatibility hazard. It's fine, I believe the future can be found there, but let's talk once that became accepted practice.

@ghost ghost closed this as completed in #405 Nov 2, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question/feedback A question or user feedback
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants