about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2018-01-25 15:52:13 +0100
committerGitHub <noreply@github.com>2018-01-25 15:52:13 +0100
commitbbdc5b9637db7d63f1754cef060bad6542b4c790 (patch)
tree30db9fd07a18fd8681d595e63dc5fcb7d52f4595
parent83603b8294861c54ed89809f9e3b12dd77367a9f (diff)
parent5de8e040d2ed8f3d9da79a4f12b9ece51c352f2e (diff)
downloadrust-bbdc5b9637db7d63f1754cef060bad6542b4c790.tar.gz
rust-bbdc5b9637db7d63f1754cef060bad6542b4c790.zip
Rollup merge of #47679 - etaoins:remove-redundant-backtrace-hint, r=estebank
Remove broken redundant backtrace hint

When the compiler driver panics it attempts to show a hint about using `RUST_BACKTRACE`. However, the logic is currently reversed to the hint is only shown if `RUST_BACKTRACE` is **already**   set:

```shell
> RUST_BACKTRACE=1 rustc /dev/null --crate-type proc-macro
error: internal compiler error: unexpected panic
...
note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'attempt to subtract with overflow', librustc_errors/emitter.rs:287:49
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

> RUST_BACKTRACE=0 rustc /dev/null --crate-type proc-macro
error: internal compiler error: unexpected panic
...
thread 'rustc' panicked at 'attempt to subtract with overflow', librustc_errors/emitter.rs:287:49
note: Run with `RUST_BACKTRACE=1` for a backtrace.
```

As the `panic` itself already has a working `RUST_BACKTRACE` hint just remove the broken duplicate hint entirely.
-rw-r--r--src/librustc_driver/lib.rs8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index 04e94979c71..e737328b75e 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -1273,14 +1273,6 @@ pub fn monitor<F: FnOnce() + Send + 'static>(f: F) {
                              &note,
                              errors::Level::Note);
             }
-            if match env::var_os("RUST_BACKTRACE") {
-                Some(val) => &val != "0",
-                None => false,
-            } {
-                handler.emit(&MultiSpan::new(),
-                             "run with `RUST_BACKTRACE=1` for a backtrace",
-                             errors::Level::Note);
-            }
 
             eprintln!("{}", str::from_utf8(&data.lock().unwrap()).unwrap());
         }