Parser error recovery in `syn` for better IDE support with proc-macros
Rust Internals [Unofficial]
May 31, 2026
kpreid:
For attribute macros and derive macros, if the macro is getting called at all, you know that
rustcthinks that the item is valid syntax and will not be producing an error. if you then get asynparse error, then you must be in a case wheresyndoesn’t support the syntaxrustcdoes, and in that case you had better tell the user that that’s the problem, becauserustcwon’t.
I'm not sure about rustc, but for rust-analyzer this is definitely not true.
Also, syntax not supported by syn is rare enough, and duplicate error, often unclear and in different place, is annoying enough, that I consider this acceptable.
Discussion in the ATmosphere