]> git.lizzy.rs Git - rust.git/commitdiff
driver: Only emit the RUST_BACKTRACE message if not present
authorRicho Healey <richo@psych0tik.net>
Sun, 24 May 2015 02:24:17 +0000 (19:24 -0700)
committerRicho Healey <richo@psych0tik.net>
Sun, 24 May 2015 02:51:44 +0000 (19:51 -0700)
src/librustc_driver/lib.rs

index 2c0e1a05c3dfab3e1f9d9a52e82ab65e5ece7661..d91a26ed4ee9b0b37ed36b1b4e4ab26a8fa6cd21 100644 (file)
@@ -831,11 +831,14 @@ fn flush(&mut self) -> io::Result<()> { Ok(()) }
                     "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());
             }