embrio-rs
embrio-rs copied to clipboard
#[embrio_async] can't handle expressions in macros
Not sure if this is something that's fixable or not. If something.await
is in the arguments to a macro expression, it can't be expanded since syn
represents the arguments to a macro invocation as an un-parsed TokenStream
.
For example, write!(output, "{}", something.read().await)
would result in a "await used outside of an async
block" compile error since our macro wouldn't see the something.read().await
as an expression or be able to traverse it.
I think the only way to solve this reliably would be to somehow ensure that we're the last macro to be expanded, which doesn't seem to be a thing, but there's a pre-rfc that sounds like what we'd need.