Skip to content

Commit 2c80938

Browse files
committed
Revert "Add colors"
This reverts commit 9fd68c9.
1 parent 448be39 commit 2c80938

File tree

4 files changed

+5
-36
lines changed

4 files changed

+5
-36
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ dependencies = [
183183
"pretty_assertions",
184184
"serde",
185185
"serde_json",
186-
"termcolor",
187186
"time",
188187
"toml",
189188
"winapi 0.3.9",

src/bootstrap/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ time = "0.1"
5050
ignore = "0.4.10"
5151
opener = "0.4"
5252
merge = "0.1.0"
53-
termcolor = "1.0"
5453

5554
[target.'cfg(windows)'.dependencies.winapi]
5655
version = "0.3"

src/bootstrap/builder.rs

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use std::time::{Duration, Instant};
1414

1515
use build_helper::{output, t};
1616
use lazy_static::lazy_static;
17-
use termcolor::{ColorSpec, WriteColor};
1817

1918
use crate::cache::{Cache, Interned, INTERNER};
2019
use crate::check;
@@ -1568,7 +1567,6 @@ impl<'a> Builder<'a> {
15681567

15691568
let (out, dur) = {
15701569
let instructions = ReplicationStep {
1571-
color: self.build.config.color,
15721570
cmd: self.kind,
15731571
name: step.name(),
15741572
path: step.path(self),
@@ -1610,7 +1608,6 @@ impl<'a> Builder<'a> {
16101608
}
16111609

16121610
struct ReplicationStep {
1613-
color: Color,
16141611
cmd: Kind,
16151612
name: &'static str,
16161613
path: PathBuf,
@@ -1623,34 +1620,20 @@ lazy_static! {
16231620
}
16241621

16251622
pub(crate) extern "C" fn print_replication_steps() {
1626-
use std::io::Write;
16271623
if let Some(step) = CURRENT_INSTRUCTIONS.lock().expect("mutex guard is dropped on panic").take()
16281624
{
1629-
let mut stdout = termcolor::StandardStream::stdout(step.color.into());
16301625
// ignore errors; we're exiting anyway
1631-
let mut yellow = ColorSpec::new();
1632-
yellow.set_fg(Some(termcolor::Color::Yellow));
1633-
let _ = stdout.set_color(&yellow);
1634-
let _ = write!(stdout, "note");
1635-
let _ = stdout.reset();
1636-
let _ = writeln!(stdout, ": failed while building {}", step.name);
1637-
1638-
let mut blue = ColorSpec::new();
1639-
blue.set_fg(Some(termcolor::Color::Blue));
1640-
let _ = stdout.set_color(&blue);
1641-
let _ = write!(stdout, "help");
1642-
let _ = stdout.reset();
1643-
let _ = write!(
1644-
stdout,
1645-
": to replicate this failure, run `./x.py {} {} --stage {}",
1626+
println!("note: failed while building {}", step.name);
1627+
print!(
1628+
"help: to replicate this failure, run `./x.py {} {} --stage {}",
16461629
step.cmd,
16471630
step.path.display(),
16481631
step.stage,
16491632
);
16501633
for arg in step.test_args {
1651-
let _ = write!(stdout, " --test-args \"{}\"", arg);
1634+
print!(" --test-args \"{}\"", arg);
16521635
}
1653-
let _ = writeln!(stdout, "`");
1636+
println!("`");
16541637
}
16551638
}
16561639

src/bootstrap/flags.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@ use std::process;
99

1010
use build_helper::t;
1111
use getopts::Options;
12-
use termcolor::ColorChoice;
1312

1413
use crate::builder::Builder;
1514
use crate::config::{Config, TargetSelection};
1615
use crate::setup::Profile;
1716
use crate::{Build, DocTests};
1817

19-
#[derive(Copy, Clone)]
2018
pub enum Color {
2119
Always,
2220
Never,
@@ -29,16 +27,6 @@ impl Default for Color {
2927
}
3028
}
3129

32-
impl From<Color> for ColorChoice {
33-
fn from(c: Color) -> Self {
34-
match c {
35-
Color::Always => ColorChoice::Always,
36-
Color::Never => ColorChoice::Never,
37-
Color::Auto => ColorChoice::Auto,
38-
}
39-
}
40-
}
41-
4230
impl std::str::FromStr for Color {
4331
type Err = ();
4432

0 commit comments

Comments
 (0)