rust-lang/rust

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.

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.

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.

Closing this in favor of #56974