Do you have a tool which parses error messages?


#1

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).

PR: https://github.com/rust-lang/rust/pull/30711


Editor compatibility and the new error format
#2

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


#3

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