diff options
| author | Ryan Cumming <etaoins@gmail.com> | 2018-01-23 19:42:46 +1100 |
|---|---|---|
| committer | Ryan Cumming <etaoins@gmail.com> | 2018-01-23 20:25:48 +1100 |
| commit | 5de8e040d2ed8f3d9da79a4f12b9ece51c352f2e (patch) | |
| tree | a71be2b50ed09dbaee363e598ed38658c687714b | |
| parent | 47a8eb7c4e24b61a8a9ab4eaff60ef65291aaa56 (diff) | |
| download | rust-5de8e040d2ed8f3d9da79a4f12b9ece51c352f2e.tar.gz rust-5de8e040d2ed8f3d9da79a4f12b9ece51c352f2e.zip | |
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.rs | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index de5559c8b14..53586c47ae0 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -1276,14 +1276,6 @@ pub fn monitor<F: FnOnce() + Send + 'static>(f: F) { ¬e, 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()); } |
