Closed CensoredUsername closed 5 months ago
This is an instance of rust-lang/rust#67062 . Currently rustc does not handle proc_macro::Delimiter::None
correctly, leading to issues with interpolated code that uses those due to macro hygiene.
This annoyingly means delimiting is going to be annoying, as the compiler will warn on unnecessary parenthesis as well. A delimit-if-not-already-delimited function is probably a good idea.
Generates a displacement of 0x15 instead of 0x1C for some reason.
The code it should generate for the displacement is:
0x1C == (::std::mem::size_of<Test> as i32) * (2 + 1) + offset_of(Test, b).
However it generates 0x15, and the only explanation for that is something like:
0x15 == (::std::mem::size_of<Test> as i32) * 2 + 1 + offset_of(Test, b).
Now this shouldn't be happening, as the code generation for all of this does use delimited groups to avoid this. But it is.