Function cargo::core::compiler::add_error_format_and_color

source ·
fn add_error_format_and_color(
    build_runner: &BuildRunner<'_, '_>,
    cmd: &mut ProcessBuilder
)
Expand description

Adds --error-format to the command to execute.

Cargo always uses JSON output. This has several benefits, such as being easier to parse, handles changing formats (for replaying cached messages), ensures atomic output (so messages aren’t interleaved), allows for intercepting messages like rmeta artifacts, etc. rustc includes a “rendered” field in the JSON message with the message properly formatted, which Cargo will extract and display to the user.