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
The code successfully compiles with 1.46.0, but it breaks with 1.47.0. The main reason is the tokenstream is different because of this PR. I was discussing the problem in this issue, Firefox seems to suffer from a similar one.
I am posting this issue here because it is obviously a matter of correctly parsing the new tokenstream, but at the same time I am a bit concerned about the "double macro indirection" I am using to trigger the issue -- I don't have the minimum idea if the data in the tokenstream is sane or not. Removing the nested parentheses from the forwardinggen_test macro, or just removing the macros completely changes the scenario, breaking the compilation for older rustc versions or making everything go fine with newer ones.
If you think that syn is right not being able to parse that tokenstream as a valid AST, it would be probably helpful for the ecosystem to open some issues in crates like try_match that is using this sort of macro forwarding hack and now are broken. I will be happy to help in that direction if necessary.
The text was updated successfully, but these errors were encountered:
The minimal test I have been able to create until now is a bit convoluted. Create a lib crate with the following
lib.rs
:Create the
inner
proc-macro crate with fullsyn
andquote
dependencies with the followinglib.rs
:The code successfully compiles with 1.46.0, but it breaks with 1.47.0. The main reason is the tokenstream is different because of this PR. I was discussing the problem in this issue, Firefox seems to suffer from a similar one.
I am posting this issue here because it is obviously a matter of correctly parsing the new tokenstream, but at the same time I am a bit concerned about the "double macro indirection" I am using to trigger the issue -- I don't have the minimum idea if the data in the tokenstream is sane or not. Removing the nested parentheses from the forwarding
gen_test
macro, or just removing the macros completely changes the scenario, breaking the compilation for older rustc versions or making everything go fine with newer ones.If you think that
syn
is right not being able to parse that tokenstream as a valid AST, it would be probably helpful for the ecosystem to open some issues in crates like try_match that is using this sort of macro forwarding hack and now are broken. I will be happy to help in that direction if necessary.The text was updated successfully, but these errors were encountered: