]> git.lizzy.rs Git - rust.git/commit
Respect `--color` when printing early errors
authorBarosl Lee <vcs@barosl.com>
Sat, 22 Aug 2015 14:51:53 +0000 (23:51 +0900)
committerBarosl Lee <vcs@barosl.com>
Tue, 25 Aug 2015 09:08:57 +0000 (18:08 +0900)
commit71f39c1a2fd98f829a6087a7f4a47a857571493c
tree899699e1f508a0ebb65a15772b91fcd954c4f057
parente195aa84b482e01b6eadf14211e4d880063a6794
Respect `--color` when printing early errors

Currently, `early_error` and `early_warn` in `librustc::session` always
use `ColorConfig::Auto`. Modify them to follow the color configuration
set by the `--color` option.

As colored output is also printed during the early stage, parsing the
`--color` option should be done as early as possible. However, there are
still some cases when the output needs to be colored before knowing the
exact color settings. In these cases, it will be defaulted to
`ColorConfig::Auto`, which is the same as before.

Fixes #27879.
src/librustc/lint/context.rs
src/librustc/session/config.rs
src/librustc/session/mod.rs
src/librustc/session/search_paths.rs
src/librustc_driver/lib.rs
src/librustdoc/lib.rs
src/test/run-pass-fulldeps/compiler-calls.rs