Improve diagnostics for parse errors in proc macro output
49b032e
Opened by Austin Bonander at
Currently we make no real effort to inform users of parse errors in procedural macro output: https://github.com/rust-lang/rust/blob/9c15de4fd59bee290848b5443c7e194fd5afb02c/src/libsyntax_ext/deriving/custom.rs#L105
People are stumbling on this in the wild: https://www.reddit.com/r/rust/comments/689ogb/how_to_debug_procmacro_derive_produced/
CC @nrc @jseyfried
I have some ideas on how to move forward but should we wait until #40939 lands? I don't think it's necessary since the changes would be (mostly) orthogonal.
This still seems to be the same useless error in 2024, would it be possible to at least print the unparseable tokens in this situation as part of the error message?
Matthias Hörmann at 2024-10-01 12:19:28