@@ -202,7 +202,6 @@ fn compile<'cfg>(
202
202
& unit. target ,
203
203
cx. files ( ) . message_cache_path ( unit) ,
204
204
cx. bcx . build_config . message_format ,
205
- cx. bcx . config . shell ( ) . err_supports_color ( ) ,
206
205
unit. show_warnings ( bcx. config ) ,
207
206
) ;
208
207
// Need to link targets on both the dirty and fresh.
@@ -1416,8 +1415,6 @@ fn envify(s: &str) -> String {
1416
1415
struct OutputOptions {
1417
1416
/// What format we're emitting from Cargo itself.
1418
1417
format : MessageFormat ,
1419
- /// Whether or not to display messages in color.
1420
- color : bool ,
1421
1418
/// Where to write the JSON messages to support playback later if the unit
1422
1419
/// is fresh. The file is created lazily so that in the normal case, lots
1423
1420
/// of empty files are not created. If this is None, the output will not
@@ -1439,14 +1436,12 @@ struct OutputOptions {
1439
1436
1440
1437
impl OutputOptions {
1441
1438
fn new ( cx : & Context < ' _ , ' _ > , unit : & Unit ) -> OutputOptions {
1442
- let color = cx. bcx . config . shell ( ) . err_supports_color ( ) ;
1443
1439
let path = cx. files ( ) . message_cache_path ( unit) ;
1444
1440
// Remove old cache, ignore ENOENT, which is the common case.
1445
1441
drop ( fs:: remove_file ( & path) ) ;
1446
1442
let cache_cell = Some ( ( path, LazyCell :: new ( ) ) ) ;
1447
1443
OutputOptions {
1448
1444
format : cx. bcx . build_config . message_format ,
1449
- color,
1450
1445
cache_cell,
1451
1446
show_diagnostics : true ,
1452
1447
warnings_seen : 0 ,
@@ -1586,13 +1581,7 @@ fn on_stderr_line_inner(
1586
1581
if msg. rendered . ends_with ( '\n' ) {
1587
1582
msg. rendered . pop ( ) ;
1588
1583
}
1589
- let rendered = if options. color {
1590
- msg. rendered
1591
- } else {
1592
- // Strip only fails if the Writer fails, which is Cursor
1593
- // on a Vec, which should never fail.
1594
- anstream:: adapter:: strip_str ( & msg. rendered ) . to_string ( )
1595
- } ;
1584
+ let rendered = msg. rendered ;
1596
1585
if options. show_diagnostics {
1597
1586
let machine_applicable: bool = msg
1598
1587
. children
@@ -1695,13 +1684,11 @@ fn replay_output_cache(
1695
1684
target : & Target ,
1696
1685
path : PathBuf ,
1697
1686
format : MessageFormat ,
1698
- color : bool ,
1699
1687
show_diagnostics : bool ,
1700
1688
) -> Work {
1701
1689
let target = target. clone ( ) ;
1702
1690
let mut options = OutputOptions {
1703
1691
format,
1704
- color,
1705
1692
cache_cell : None ,
1706
1693
show_diagnostics,
1707
1694
warnings_seen : 0 ,
0 commit comments