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()); }