From 1b3465cf9eb8063b22649a34ba780b17eb78b253 Mon Sep 17 00:00:00 2001 From: Richo Healey Date: Sat, 23 May 2015 19:24:17 -0700 Subject: [PATCH] driver: Only emit the RUST_BACKTRACE message if not present --- src/librustc_driver/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 2c0e1a05c3dfa..d91a26ed4ee9b 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -831,11 +831,14 @@ pub fn monitor(f: F) { "the compiler unexpectedly panicked. this is a bug.".to_string(), format!("we would appreciate a bug report: {}", BUG_REPORT_URL), - "run with `RUST_BACKTRACE=1` for a backtrace".to_string(), ]; for note in &xs { emitter.emit(None, ¬e[..], None, diagnostic::Note) } + if let None = env::var_os("RUST_BACKTRACE") { + emitter.emit(None, "run with `RUST_BACKTRACE=1` for a backtrace", + None, diagnostic::Note); + } println!("{}", str::from_utf8(&data.lock().unwrap()).unwrap()); }