Skip to content

Instantly share code, notes, and snippets.

@robinst
Last active October 19, 2017 02:00
Show Gist options
  • Save robinst/67aadb58b13492c746046b274de9b8d3 to your computer and use it in GitHub Desktop.
Save robinst/67aadb58b13492c746046b274de9b8d3 to your computer and use it in GitHub Desktop.
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:335:20
stack backtrace:
0: std::sys::imp::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: std::panicking::begin_panic_fmt
7: rust_begin_unwind
8: core::panicking::panic_fmt
9: core::panicking::panic
10: <core::option::Option<T>>::unwrap <-- nothing about "bar"
11: foo::main
12: __rust_maybe_catch_panic
13: std::rt::lang_start
14: main
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:335:20
stack backtrace:
0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:69
2: std::panicking::default_hook::{{closure}}
at src/libstd/sys_common/backtrace.rs:58
at src/libstd/panicking.rs:381
3: std::panicking::default_hook
at src/libstd/panicking.rs:397
4: std::panicking::begin_panic
at src/libstd/panicking.rs:577
5: std::panicking::begin_panic
at src/libstd/panicking.rs:538
6: std::panicking::try::do_call
at src/libstd/panicking.rs:522
7: std::panicking::try::do_call
at src/libstd/panicking.rs:498
8: <core::ops::range::Range<Idx> as core::fmt::Debug>::fmt
at src/libcore/panicking.rs:71
9: <core::ops::range::Range<Idx> as core::fmt::Debug>::fmt
at src/libcore/panicking.rs:51
10: <core::option::Option<T>>::unwrap
at /Users/travis/build/rust-lang/rust/src/libcore/macros.rs:20
11: foo::main
at ./foo.rs:2
12: panic_unwind::dwarf::eh::read_encoded_pointer
at src/libpanic_unwind/lib.rs:99
13: rust_panic
at src/libstd/panicking.rs:459
at src/libstd/panic.rs:361
at src/libstd/rt.rs:59
14: foo::bar
fn main() {
bar().unwrap();
}
fn bar() -> Option<String> {
None
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment