Open kvark opened 5 years ago
I investigated this a bit last night. To get source for parsing, cbindgen runs:
cargo rustc --lib --manifest-path /Users/josh/Projects/wgpu-native/wgpu-native/Cargo.toml -p wgpu-native:0.1.0 -- -Z unstable-options --pretty=expanded
But the output of this command doesn't compile in Rust, because it fails on the $
:
So I don't really expect syn to parse this because it doesn't even compile. It would be useful if somebody could help clarify whether the issue related to the rustc macro expansion, syn, or cbindgen?
I would expect $crate
to be expanded using --pretty=expanded
the same way all the other macro $variables
are expanded.
It seems related to rustc changing behavior for macro expansion between 2018-12-27-fb86d604b
and 2018-12-28-60e825389
nightlies.
I have an example here which displays the difference in output https://gist.github.com/grovesNL/5d3ddc7b95c1939be26c64ba09f1ac2f
I also mentioned it on a PR which appears to be related rust-lang/rust#57155
if you print something in macro, then this error will be raised.
Repro steps on Linux:
Error: