Just to put something to the article about "usability" of the stack trace and watching that there is a ongoing PR to "clean" a little the output, I will add this
Taking the original example
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ()', src/libcore/result.rs:837
stack backtrace:
1: 0x56381e42288e - std::sys::imp::backtrace::tracing::imp::write::hfc2edb670e5eda97
2: 0x56381e424b91 - std::panicking::default_hook::{{closure}}::hc66a547fab0b4d38
3: 0x56381e424776 - std::panicking::default_hook::h7fba1b2f69474bdc
4: 0x56381e424f78 - std::panicking::rust_panic_with_hook::h5d3597668c9f0035
5: 0x56381e424e12 - std::panicking::begin_panic::hfaa38fdbc7d103f6
6: 0x56381e424d50 - std::panicking::begin_panic_fmt::h69e0397ed8fc5362
7: 0x56381e424cd1 - rust_begin_unwind
8: 0x56381e46db2f - core::panicking::panic_fmt::h2ba266031787cf7b
9: 0x56381e41cc55 - core::result::unwrap_failed::h0a78b8b4914ea99c
at /home/yamakaky/dev/rust/rust/src/libcore/macros.rs:29
10: 0x56381e41c99b - <core::result::Result<T, E>>::unwrap::h2f7c43c0e2d4b7cd
at /home/yamakaky/dev/rust/rust/src/libcore/result.rs:737
11: 0x56381e41ccd8 - t::main::h86d9b74d94eb7fff
at /tmp/pote/t.rs:2
12: 0x56381e42f0f6 - __rust_maybe_catch_panic
13: 0x56381e4255a8 - std::rt::lang_start::ha33d35ddc5bfd7d2
14: 0x56381e41cd12 - main
15: 0x7f6dc966c290 - __libc_start_main
16: 0x56381e41c7f9 - _start
Can be put some like
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ()', src/libcore/result.rs:837
stack backtrace:
1: std::sys::imp::backtrace::tracing::imp::write <- std::panicking::default_hook::{{closure}}
3: std::panicking::default_hook <- std::panicking::rust_panic_with_hook <- std::panicking::begin_panic
6: std::panicking::begin_panic_fmt <- rust_begin_unwind
8: core::panicking::panic_fmt <- core::result::unwrap_failed
at /home/yamakaky/dev/rust/rust/src/libcore/macros.rs:29
10: <core::result::Result<T, E>>::unwrap
at /home/yamakaky/dev/rust/rust/src/libcore/result.rs:737
11: t::main::h86d9b74d94eb7fff at /tmp/pote/t.rs:2 <- __rust_maybe_catch_panic
13: std::rt::lang_start::ha33d35ddc5bfd7d2 <- main <- __libc_start_main <- _start
Even more it could be only the list of the functions and on each change (from file or library, print the switch)
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ()', src/libcore/result.rs:837
stack backtrace:
1: std::sys::imp::backtrace::tracing::imp::write, std::panicking::default_hook::{{closure}},
3: default_hook, rust_panic_with_hook, begin_panic, begin_panic_fmt, rust_begin_unwind,
8: core::panicking::panic_fmt, core::result::unwrap_failed at /home/yamakaky/dev/rust/rust/src/libcore/macros.rs:29
10: <core::result::Result<T, E>>::unwrap at /home/yamakaky/dev/rust/rust/src/libcore/result.rs:737
11: t::main at /tmp/pote/t.rs:2, __rust_maybe_catch_panic, std::rt::lang_start, main, __libc_start_main, _start
Also I have an extra question... backtraces are for know where... but what about the data?? why it is never printed? it would be nice i the callback can be unrolled with the passed arguments to each funtion (well that can be done in a debugger, thought maybe in one or two places coul clear it up a little more, I mean normally if you are working on terminal you see the stack trace, the next step would be to maybe put a log there to print the values ;).