Skip to content

Commit

Permalink
driver: Only emit the RUST_BACKTRACE message if not present
Browse files Browse the repository at this point in the history
  • Loading branch information
richo committed May 24, 2015
1 parent 0c2642a commit 1b3465c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/librustc_driver/lib.rs
Expand Up @@ -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());
}
Expand Down

0 comments on commit 1b3465c

Please sign in to comment.