Skip to content

Commit 1b3465c

Browse files
committed
driver: Only emit the RUST_BACKTRACE message if not present
1 parent 0c2642a commit 1b3465c

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)