-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.38 regression ? proc-macro derive panicked if there is r# in front of the attribute name #64924
Comments
Looks very similar to #63894 (pretty-printing change making raw identifiers to be printed precisely). |
I suspect the attribute or derive expects identifier (It would be nice if someone could check how the expanded code looks like and whether my guess is correct.) |
@petrochenkov How can I see what the expanded code looks like ? Thanks |
|
FYI, here is the macro: https://github.com/Devolutions/cowrpc-rs/tree/master/cowrpc_derive/src I looked the code generated in my case. I'm not sure to understand your point when you say that it expects identifier async in its input. I looked the macro code (https://github.com/Devolutions/cowrpc-rs/tree/master/cowrpc_derive/src), it is true that it compare the ident name with "async" (https://github.com/Devolutions/cowrpc-rs/blob/master/cowrpc_derive/src/iface/attr.rs#L30), but it would raise an error if you provide something that macro doesn't support, for example #[cowrpc(foostring)] would raise an error "There is no word attribute you can use on data types with cowrpc". I can see that we use syn: 0.13 and proc-macro2: 0.3. I guess the error message is comming at the beginning when we do syn::parse(input)... but if we didn't change the dependencies, should not be a problem... FYI, I updated the code to edition 2018 where async is now a reserved word. It changed code to add lot of r# in front of async, but should not be a problem. Thanks for your help |
@rustbot modify labels to +I-prioritize |
Assigning |
I have a macro and it defines an attribute called "async". When I use it, I add r# in front of it. I have this :
Since 1.38.0, it fails with
It was building without any error before. What is different with 1.38?
The text was updated successfully, but these errors were encountered: