Do you have a tool which parses error messages?


The Rust compiler can now (well, when the PR lands) emit error and warning messages in JSON format. If you have a tool which parses error messages, you should use this format rather than the human-readable output. It should be more stable in the long run, give you more information, and be easier to handle.

To get errors in this format, use -Zunstable-options --output=json (the option might change name before landing, I’ll update here).


Editor compatibility and the new error format

What would be the preferred way to use this option with cargo? Something like this cargo rustc -- -Zunstable-options --output=json ?


Yes, that should work. It will only apply those options to the last crate to be compiled, unfortunately.