Allow the unstable --error-format flag to be changed from an environment variable #1693
Labels
T-compiler
Relevant to the compiler team, which will review and decide on the RFC.
T-dev-tools
Relevant to the development tools team, which will review and decide on the RFC.
Continuing discussion from https://github.com/saviorisdead/RustyCode/issues/146:
I've been working towards adding support for the new JSON error format in RustyCode, however I've come across a bit of an issue that slows down iteration times for users. If the IDE extension issues cargo commands with the
RUSTFLAGS
environment variable set to-Z unstable-options --error-format=json
then, as expected, we get JSON error messages. If the user was to then manually compile their project from a terminal withcargo build
, the fingerprint changes becauseRUSTFLAGS
no longer matches the last compilation and a full rebuild occurs. This also occurs the next time the user builds or saves the file from the IDE for the same reason.For some (
clippy
,check
) subcommands, this can be avoided by passing the arguments in directly. Some, however, can't facilitate this (bench
,test
,build
, etc.).I propose a new environment variable called
RUST_ERROR_FORMAT
that only changes the format that errors are printed with without changing the fingerprint. My only concern is that because this is an unstable feature right now, such an environment variable would bypass-Z unstable-options
.The text was updated successfully, but these errors were encountered: