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

select macro uses ident instead of expr #6

Open
PvdBerg1998 opened this issue Sep 30, 2019 · 4 comments
Open

select macro uses ident instead of expr #6

PvdBerg1998 opened this issue Sep 30, 2019 · 4 comments

Comments

@PvdBerg1998
Copy link

Is there a safety reason for this? Otherwise it'd greatly improve user friendlyness if the macro could take an expression instead of an identifier!

@Alxandr
Copy link

Alxandr commented Nov 7, 2019

Same with join (and I'm guessing try_select and try_join).

@skade
Copy link

skade commented Nov 7, 2019

There's no safety reasons for this, we accept patches to have macros accept a wider array of options and forms.

@yoshuawuyts
Copy link
Collaborator

Afaik @taiki-e tried to make this work for futures-rs as well, and they ended up having to write a proc macro. For compile-speed reasons we've chosen not to include proc macros by default in our codebase, so that wouldn't be an option for us.

In async-rs/async-std#405 we've added Future::race which should help alleviate things somewhat. I've also filed async-rs/async-std#470 to help with the most common join cases as well. Hopefully this is enough to make futures concurrency a bit nicer to work with.

Thanks!

@skade
Copy link

skade commented Nov 7, 2019

Geoffroy gave a hint at a slightly better version here: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=fd5313767dfa99e460c60a33d940cef8

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

No branches or pull requests

4 participants