-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Literal from macro expansion is not accepted in typescript_custom_section since rust 1.47.0 #2393
Labels
Comments
Hm can you confirm what version of Rust you're using? 1.17 is quite old, and I'd recommend using something more in the 1.40 range |
@alexcrichton oh sorry, that was totally a typo on my side, the version is 1.48.0, I have confirmed it not working since 1.47.0, and working on 1.46.0. |
Frizi
changed the title
Literal from macro expansion is not accepted in typescript_custom_section since rust 1.17.0
Literal from macro expansion is not accepted in typescript_custom_section since rust 1.47.0
Dec 7, 2020
Aha makes sense! I'll try to investigate this this week. |
alexcrichton
added a commit
to alexcrichton/wasm-bindgen
that referenced
this issue
Dec 9, 2020
We explicitly match on `Expr` in a few locations so it's necessary to peel back `Expr::Group` like we do with `Type::Group`. Closes rustwasm#2393
alexcrichton
added a commit
that referenced
this issue
Dec 9, 2020
We explicitly match on `Expr` in a few locations so it's necessary to peel back `Expr::Group` like we do with `Type::Group`. Closes #2393
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the Bug
Since the update to rust 1.47.0, typescript_custom_section doesn't work with literal captures expanded by macro.
In previous versions of rust, everything worked as expected.
The reported error is
Reproduction
The snippet above represent the code that used to work, but doesn't anymore. I've printed the actual AST that
syn::ItemConst::macro_parse
received, and got this:Which means, now rust expands the
literal
(and possibly other) captures as an expression group with one item, and this should probably be handled in various places in the parser.Current workaround
I managed to fix it in my specific case by using
tt
capture instead ofliteral
, but this is obviously more general than i would like.The text was updated successfully, but these errors were encountered: