Skip to content

Instantly share code, notes, and snippets.

@durka
Created April 9, 2018 01:24
Show Gist options
  • Save durka/ec544b738bf94ebb43b79852e02f110f to your computer and use it in GitHub Desktop.
Save durka/ec544b738bf94ebb43b79852e02f110f to your computer and use it in GitHub Desktop.
$ RUST_BACKTRACE=1 cargo script -e 'std::thread::spawn(|| { panic!("foo"); }).join().unwrap();'
thread '<unnamed>' panicked at 'foo', expr.rs:18:36
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
1: std::sys_common::backtrace::print
2: std::panicking::default_hook::{{closure}}
3: std::panicking::default_hook
4: std::panicking::rust_panic_with_hook
5: std::panicking::begin_panic
6: expr::try_main::{{closure}}
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Any', libcore/result.rs:945:5
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
1: std::sys_common::backtrace::print
2: std::panicking::default_hook::{{closure}}
3: std::panicking::default_hook
4: std::panicking::rust_panic_with_hook
5: std::panicking::begin_panic_fmt
6: rust_begin_unwind
7: core::panicking::panic_fmt
8: core::result::unwrap_failed
9: <core::result::Result<T, E>>::unwrap
10: expr::try_main
11: expr::main
12: std::rt::lang_start::{{closure}}
13: std::panicking::try::do_call
14: __rust_maybe_catch_panic
15: std::rt::lang_start_internal
16: main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment