You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
There's also been discussion of having an API for a proc-macro to ask rustc to expand inner macros. I can't think of a way to work around this in general without support from the compiler.
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 sincesyn
represents the arguments to a macro invocation as an un-parsedTokenStream
.For example,
write!(output, "{}", something.read().await)
would result in a "await used outside of anasync
block" compile error since our macro wouldn't see thesomething.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.
The text was updated successfully, but these errors were encountered: