Skip to content

Respect --color when printing early errors #27983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 31, 2015
Merged

Conversation

barosl
Copy link
Contributor

@barosl barosl commented Aug 24, 2015

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.

@rust-highfive
Copy link
Contributor

r? @arielb1

(rust_highfive has picked a reviewer for you, use r? to override)

@brson
Copy link
Contributor

brson commented Aug 25, 2015

r? @nrc

@rust-highfive rust-highfive assigned nrc and unassigned arielb1 Aug 25, 2015
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 rust-lang#27879.
@steveklabnik
Copy link
Member

👍

@nrc
Copy link
Member

nrc commented Aug 30, 2015

@bors: r+

@bors
Copy link
Collaborator

bors commented Aug 30, 2015

📌 Commit 71f39c1 has been approved by nrc

@bors
Copy link
Collaborator

bors commented Aug 30, 2015

⌛ Testing commit 71f39c1 with merge fe9cef7...

bors added a commit that referenced this pull request Aug 30, 2015
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.
@bors bors merged commit 71f39c1 into rust-lang:master Aug 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants