Skip to content

Commit bbdc5b9

Browse files
Rollup merge of rust-lang#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.
2 parents 83603b8 + 5de8e04 commit bbdc5b9

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/librustc_driver/lib.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,14 +1273,6 @@ pub fn monitor<F: FnOnce() + Send + 'static>(f: F) {
12731273
&note,
12741274
errors::Level::Note);
12751275
}
1276-
if match env::var_os("RUST_BACKTRACE") {
1277-
Some(val) => &val != "0",
1278-
None => false,
1279-
} {
1280-
handler.emit(&MultiSpan::new(),
1281-
"run with `RUST_BACKTRACE=1` for a backtrace",
1282-
errors::Level::Note);
1283-
}
12841276

12851277
eprintln!("{}", str::from_utf8(&data.lock().unwrap()).unwrap());
12861278
}

0 commit comments

Comments
 (0)