driver: Only emit the RUST_BACKTRACE message if not present

This commit is contained in:
Richo Healey 2015-05-23 19:24:17 -07:00
parent 0c2642a571
commit 1b3465cf9e

View file

@ -831,11 +831,14 @@ pub fn monitor<F:FnOnce()+Send+'static>(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, &note[..], 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());
}