Improvement of RUST_BACKTRACE merged on latest nightlies

The default RUST_BACKTRACE=1 output now tries to remove irrelevant frames from the backtrace. So for

fn main() {

We go from

thread 'main' panicked at 'explicit panic',
stack backtrace:
   0:     0x5559640c8cc3 - std::sys::imp::backtrace::tracing::imp::unwind_backtrace::h3c67687ba454b78b
                               at /checkout/src/libstd/sys/unix/backtrace/tracing/
   1:     0x5559640c5224 - std::sys_common::backtrace::_print::h701c2403afe49d2d
                               at /checkout/src/libstd/sys_common/
   2:     0x5559640ca23c - std::panicking::default_hook::{{closure}}::h07b8ee04b5734d1a
                               at /checkout/src/libstd/sys_common/
                               at /checkout/src/libstd/
   3:     0x5559640c9e06 - std::panicking::default_hook::h23eeafbf7c1c05c3
                               at /checkout/src/libstd/
   4:     0x5559640ca5db - std::panicking::rust_panic_with_hook::hd0067971b6d1240e
                               at /checkout/src/libstd/
   5:     0x5559640c0dd3 - std::panicking::begin_panic::hf4f7d3d7e8e7863f
                               at /checkout/src/libstd/
   6:     0x5559640c0f82 - t::main::hf31397ea67eea730
                               at /tmp/
   7:     0x5559640d1fca - __rust_maybe_catch_panic
                               at /checkout/src/libpanic_unwind/
   8:     0x5559640cab26 - std::rt::lang_start::hb7fc7ec87b663023
                               at /checkout/src/libstd/
                               at /checkout/src/libstd/
                               at /checkout/src/libstd/
   9:     0x5559640c0fc2 - main
  10:     0x7f0af7240290 - __libc_start_main
  11:     0x5559640c0bf9 - _start
  12:                0x0 - <unknown>


thread 'main' panicked at 'explicit panic',
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: t::main
             at ./

Use RUST_BACKTRACE=full for the old behaviour.

Please reports cases where the backtrace is not cleaned properly. For example, panics in tests and threads other that the main are known to have trouble with this.


This was an execellent improvement @Yamakaky. I added it to the release milestone predictions for 1.17.


Thanks :wink:

@Yamakaky When manually printing a stacktrace in my panic hook, how can I skip irrelevant stackframes, like those that don't belong to my executable but lower layers?