diff options
| author | kennytm <kennytm@gmail.com> | 2018-12-07 12:42:34 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-07 12:42:34 +0800 |
| commit | aa5ba8315ad022c4ad73d2e4e011d6e17bd6f056 (patch) | |
| tree | b9909afeacc14a5982103fd74431591d0bb26895 | |
| parent | 0e41ef13aac432d7c33f9e1287270769deb69c3f (diff) | |
| parent | 84443a3a241a1e513ba03bd40d4ffd623a3ff381 (diff) | |
Rollup merge of #56555 - Mark-Simulacrum:stderr-profile, r=wesleywiser
Send textual profile data to stderr, not stdout This makes it possible to run with RUSTFLAGS="-Zself-profile" without having to redirect compiler output; otherwise Cargo will error out due to non-empty compiler stdout. r? @wesleywiser
| -rw-r--r-- | src/librustc/util/profiling.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc/util/profiling.rs b/src/librustc/util/profiling.rs index bea3453b31a..1e648c45817 100644 --- a/src/librustc/util/profiling.rs +++ b/src/librustc/util/profiling.rs @@ -11,7 +11,7 @@ use session::config::Options; use std::fs; -use std::io::{self, StdoutLock, Write}; +use std::io::{self, StderrLock, Write}; use std::time::{Duration, Instant}; macro_rules! define_categories { @@ -61,7 +61,7 @@ macro_rules! define_categories { } } - fn print(&self, lock: &mut StdoutLock<'_>) { + fn print(&self, lock: &mut StderrLock<'_>) { writeln!(lock, "| Phase | Time (ms) | Queries | Hits (%) |") .unwrap(); writeln!(lock, "| ---------------- | -------------- | -------------- | -------- |") @@ -235,7 +235,7 @@ impl SelfProfiler { self.timer_stack.is_empty(), "there were timers running when print_results() was called"); - let out = io::stdout(); + let out = io::stderr(); let mut lock = out.lock(); let crate_name = |
