await macro is not in libcore.
WildCryptoFox opened this issue · 6 comments
The await!() macro is defined in std but not in core, is there any reason for this?
It uses thread local storage, which isnt available outside libstd.
@bjorn3 Hm. So it does. Looks like @Nemo157 's embrio fills the spot.
https://github.com/Nemo157/embrio-rs/blob/master/embrio-async/dehygiene/src/lib.rs
It's intended to be moved to core at some point (there's a few ways to reimplement it, embrio-async's implementation is one but has some relatively spread out safety guarantees, adding the ability for generators to take resume arguments is another that I think would avoid needing any unsafe code at all).
I thought this was already noted on the tracking issue (#50547), but looking at it again it doesn't appear so, adding this issue to the unresolved questions would probably be useful.
Thanks @Nemo157
Marking as not blocking for stabilization. Obviously we want things to work from core eventually, but it's ok if that doesn't work to start. Moreover, the major blocker here is resolving how generator arguments should work -- once that works, it seems clear that we'll be able to solve this.