Skip to content

Commit 1b04762

Browse files
author
Jonathan Turner
committed
Special case a few colors for Windows
1 parent 7a187c3 commit 1b04762

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/librustc_errors/emitter.rs

+13-2
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,11 @@ impl Destination {
883883
Style::FileNameStyle | Style::LineAndColumn => {}
884884
Style::LineNumber => {
885885
try!(self.start_attr(term::Attr::Bold));
886-
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE)));
886+
if cfg!(windows) {
887+
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_CYAN)));
888+
} else {
889+
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE)));
890+
}
887891
}
888892
Style::ErrorCode => {
889893
try!(self.start_attr(term::Attr::Bold));
@@ -896,6 +900,9 @@ impl Destination {
896900
}
897901
Style::OldSchoolNoteText | Style::HeaderMsg => {
898902
try!(self.start_attr(term::Attr::Bold));
903+
if cfg!(windows) {
904+
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_WHITE)));
905+
}
899906
}
900907
Style::UnderlinePrimary | Style::LabelPrimary => {
901908
try!(self.start_attr(term::Attr::Bold));
@@ -904,7 +911,11 @@ impl Destination {
904911
Style::UnderlineSecondary |
905912
Style::LabelSecondary => {
906913
try!(self.start_attr(term::Attr::Bold));
907-
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE)));
914+
if cfg!(windows) {
915+
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_CYAN)));
916+
} else {
917+
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE)));
918+
}
908919
}
909920
Style::NoStyle => {}
910921
Style::Level(l) => {

src/librustc_errors/lib.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,13 @@ impl Level {
732732
pub fn color(self) -> term::color::Color {
733733
match self {
734734
Bug | Fatal | PhaseFatal | Error => term::color::BRIGHT_RED,
735-
Warning => term::color::YELLOW,
735+
Warning => {
736+
if cfg!(windows) {
737+
term::color::BRIGHT_YELLOW
738+
} else {
739+
term::color::YELLOW
740+
}
741+
},
736742
Note => term::color::BRIGHT_GREEN,
737743
Help => term::color::BRIGHT_CYAN,
738744
Cancelled => unreachable!(),

0 commit comments

Comments
 (0)