Skip to content

Commit aa5ba83

Browse files
authored
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
2 parents 0e41ef1 + 84443a3 commit aa5ba83

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc/util/profiling.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use session::config::Options;
1212

1313
use std::fs;
14-
use std::io::{self, StdoutLock, Write};
14+
use std::io::{self, StderrLock, Write};
1515
use std::time::{Duration, Instant};
1616

1717
macro_rules! define_categories {
@@ -61,7 +61,7 @@ macro_rules! define_categories {
6161
}
6262
}
6363

64-
fn print(&self, lock: &mut StdoutLock<'_>) {
64+
fn print(&self, lock: &mut StderrLock<'_>) {
6565
writeln!(lock, "| Phase | Time (ms) | Queries | Hits (%) |")
6666
.unwrap();
6767
writeln!(lock, "| ---------------- | -------------- | -------------- | -------- |")
@@ -235,7 +235,7 @@ impl SelfProfiler {
235235
self.timer_stack.is_empty(),
236236
"there were timers running when print_results() was called");
237237

238-
let out = io::stdout();
238+
let out = io::stderr();
239239
let mut lock = out.lock();
240240

241241
let crate_name =

0 commit comments

Comments
 (0)