Skip to content

Commit a97b3ff

Browse files
committed
Auto merge of #25741 - richo:backtrace-message, r=alexcrichton
The second commit seems reasonable to me but I can remove if it's contentious. The first is purely cosmetic but has been irking me for ages.
2 parents e4c64a1 + 1b3465c commit a97b3ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/librustc_driver/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -831,11 +831,14 @@ pub fn monitor<F:FnOnce()+Send+'static>(f: F) {
831831
"the compiler unexpectedly panicked. this is a bug.".to_string(),
832832
format!("we would appreciate a bug report: {}",
833833
BUG_REPORT_URL),
834-
"run with `RUST_BACKTRACE=1` for a backtrace".to_string(),
835834
];
836835
for note in &xs {
837836
emitter.emit(None, &note[..], None, diagnostic::Note)
838837
}
838+
if let None = env::var_os("RUST_BACKTRACE") {
839+
emitter.emit(None, "run with `RUST_BACKTRACE=1` for a backtrace",
840+
None, diagnostic::Note);
841+
}
839842

840843
println!("{}", str::from_utf8(&data.lock().unwrap()).unwrap());
841844
}

0 commit comments

Comments
 (0)