File tree 1 file changed +10
-10
lines changed
compiler/rustc_errors/src
1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -2674,6 +2674,14 @@ fn from_stderr(color: ColorConfig) -> Destination {
2674
2674
}
2675
2675
}
2676
2676
2677
+ /// On Windows, BRIGHT_BLUE is hard to read on black. Use cyan instead.
2678
+ ///
2679
+ /// See #36178.
2680
+ #[ cfg( windows) ]
2681
+ const BRIGHT_BLUE : Color = Color :: Cyan ;
2682
+ #[ cfg( not( windows) ) ]
2683
+ const BRIGHT_BLUE : Color = Color :: Blue ;
2684
+
2677
2685
impl Style {
2678
2686
fn color_spec ( & self , lvl : Level ) -> ColorSpec {
2679
2687
let mut spec = ColorSpec :: new ( ) ;
@@ -2688,11 +2696,7 @@ impl Style {
2688
2696
Style :: LineNumber => {
2689
2697
spec. set_bold ( true ) ;
2690
2698
spec. set_intense ( true ) ;
2691
- if cfg ! ( windows) {
2692
- spec. set_fg ( Some ( Color :: Cyan ) ) ;
2693
- } else {
2694
- spec. set_fg ( Some ( Color :: Blue ) ) ;
2695
- }
2699
+ spec. set_fg ( Some ( BRIGHT_BLUE ) ) ;
2696
2700
}
2697
2701
Style :: Quotation => { }
2698
2702
Style :: MainHeaderMsg => {
@@ -2707,11 +2711,7 @@ impl Style {
2707
2711
}
2708
2712
Style :: UnderlineSecondary | Style :: LabelSecondary => {
2709
2713
spec. set_bold ( true ) . set_intense ( true ) ;
2710
- if cfg ! ( windows) {
2711
- spec. set_fg ( Some ( Color :: Cyan ) ) ;
2712
- } else {
2713
- spec. set_fg ( Some ( Color :: Blue ) ) ;
2714
- }
2714
+ spec. set_fg ( Some ( BRIGHT_BLUE ) ) ;
2715
2715
}
2716
2716
Style :: HeaderMsg | Style :: NoStyle => { }
2717
2717
Style :: Level ( lvl) => {
You can’t perform that action at this time.
0 commit comments