Open taiki-e opened 5 years ago
Currently, procedural macros provided by futures-async-stream cannot handle expressions in macros.
https://github.com/rust-lang-nursery/futures-rs/pull/1548#discussion_r285341883:
It is not possible to replace .await in macros such as assert!(foo.await) with this. Full support for this can not be done without compiler support, but it can support for some kinds of macros (however, this is not necessarily preferable, as a macro may call an async block etc): https://github.com/taiki-e/futures-rs/commit/fb33504229db314fb97759c3170ee3ad73785c08
It is not possible to replace .await in macros such as assert!(foo.await) with this.
.await
assert!(foo.await)
Full support for this can not be done without compiler support, but it can support for some kinds of macros (however, this is not necessarily preferable, as a macro may call an async block etc): https://github.com/taiki-e/futures-rs/commit/fb33504229db314fb97759c3170ee3ad73785c08
Related: https://github.com/Nemo157/embrio-rs/issues/14
Refs: https://github.com/taiki-e/futures-async-stream/commit/5198fe4eced00a23b7a0235bc1333d4535fe3501
Also looks like yield in a macro is not possible. I was trying to use a local macro to limit code duplication inside a function.
yield
Currently, procedural macros provided by futures-async-stream cannot handle expressions in macros.
https://github.com/rust-lang-nursery/futures-rs/pull/1548#discussion_r285341883:
Related: https://github.com/Nemo157/embrio-rs/issues/14
Refs: https://github.com/taiki-e/futures-async-stream/commit/5198fe4eced00a23b7a0235bc1333d4535fe3501