<p dir="auto">This is a tracking issue for the unstable <code class="notranslate">result_expect</code> feature in the standard library. This is likely ready to just be stabilized as-is</p>
<p dir="auto">GDB backtrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#0  0x00007ffff1e5fe60 in __cxa_throw () from /usr/lib/libstdc++.so.6
#1  0x00007ffff2ffea2a in rust_begin_unwind (token=839147) at /home/rust/rust/src/rt/rust_builtin.cpp:533
#2  0x00007ffff7612586 in std::rt::task::Unwinder::begin_unwind () at src/libstd/rt/task.rs:477
#3  0x00007ffff75b8925 in std::rt::task::begin_unwind () at src/libstd/rt/task.rs:612
#4  0x00007ffff75b8a33 in fn46407 () at src/libstd/sys.rs:40
#5  0x00007ffff75b7e09 in fn46394 () at src/libstd/c_str.rs:307
#6  0x00007ffff75b7d5b in std::vec::MutableVector$__extensions__::as_mut_buf&lt;u8&gt; () at src/libstd/vec.rs:2017
#7  0x00007ffff75b7b45 in std::c_str::with_c_str&lt;!&gt; () at src/libstd/c_str.rs:307
#8  0x00007ffff75b7939 in std::c_str::ToCStr$__extensions__::with_c_str&lt;!&gt; () at src/libstd/c_str.rs:287
#9  0x00007ffff75b7897 in std::c_str::ToCStr$__extensions__::with_c_str&lt;!&gt; () at src/libstd/c_str.rs:249
#10 0x00007ffff75b89b1 in fn46404 () at src/libstd/sys.rs:40
#11 0x00007ffff75b7e09 in fn46394 () at src/libstd/c_str.rs:307
#12 0x00007ffff75b7d5b in std::vec::MutableVector$__extensions__::as_mut_buf&lt;u8&gt; () at src/libstd/vec.rs:2017
#13 0x00007ffff75b7b45 in std::c_str::with_c_str&lt;!&gt; () at src/libstd/c_str.rs:307
#14 0x00007ffff75b7939 in std::c_str::ToCStr$__extensions__::with_c_str&lt;!&gt; () at src/libstd/c_str.rs:287
#15 0x00007ffff75b7897 in std::c_str::ToCStr$__extensions__::with_c_str&lt;!&gt; () at src/libstd/c_str.rs:249
#16 0x00007ffff7482ecd in std::sys::FailWithCause$__extensions__::fail_with () at src/libstd/sys.rs:40
#17 0x00007ffff64f7348 in syntax::diagnostic::handler$HandlerT::fatal () at src/libsyntax/diagnostic.rs:29
#18 0x00007ffff64f82d9 in syntax::diagnostic::handler$HandlerT::bug () at src/libsyntax/diagnostic.rs:135
#19 0x00007ffff4e8abcb in rustc::driver::session::Session_::bug () at src/librustc/driver/session.rs:256
#20 0x00007ffff4e8cf57 in rustc::middle::ty::node_id_to_type () at src/librustc/middle/ty.rs:2799
#21 0x00007ffff5072738 in rustc::middle::ty::expr_ty () at src/librustc/middle/ty.rs:2960
#22 0x00007ffff583db8b in rustc::middle::const_eval::ConstEvalVisitor::lookup_constness ()
    at src/librustc/middle/const_eval.rs:262
#23 0x00007ffff583bec3 in rustc::middle::const_eval::ConstEvalVisitor::classify ()
    at src/librustc/middle/const_eval.rs:249
#24 0x00007ffff58407a7 in rustc::middle::const_eval::Visitor$ConstEvalVisitor::visit_expr_post ()
    at src/librustc/middle/const_eval.rs:277
#25 0x00007ffff5845404 in visit::walk_expr::hfa295b274c17508aay::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#26 0x00007ffff5842268 in visit::Visitor::visit_expr::h1a24411352624b7ax::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#27 0x00007ffff5845628 in visit::walk_exprs::h1467dd839791d97aaz::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#28 0x00007ffff5843b98 in visit::walk_expr::hfa295b274c17508aay::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#29 0x00007ffff5842268 in visit::Visitor::visit_expr::h1a24411352624b7ax::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#30 0x00007ffff5843db7 in visit::walk_expr::hfa295b274c17508aay::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#31 0x00007ffff5842268 in visit::Visitor::visit_expr::h1a24411352624b7ax::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#32 0x00007ffff5844102 in visit::walk_expr::hfa295b274c17508aay::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#33 0x00007ffff5842268 in visit::Visitor::visit_expr::h1a24411352624b7ax::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#34 0x00007ffff5845f18 in visit::walk_stmt::hee2bec38e02f8aaF::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#35 0x00007ffff5845d52 in visit::Visitor::visit_stmt::hb94918db37abda88aE::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#36 0x00007ffff5845c91 in visit::walk_block::h4984e27ce75811daD::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#37 0x00007ffff58459fa in visit::Visitor::visit_block::h7e3e6d1942d24c33aC::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#38 0x00007ffff5847e10 in visit::walk_fn::h9fa0431031d49545aR::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#39 0x00007ffff5847bff in visit::Visitor::visit_fn::h93d4aa2ed2db35aeaQ::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#40 0x00007ffff5848f5b in visit::walk_method_helper::hfc8bf51419c0129aa4::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#41 0x00007ffff5841e9c in visit::walk_item::hda6dd8554fcbf892av::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#42 0x00007ffff5841212 in visit::Visitor::visit_item::h7ca8716289d5d081au::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#43 0x00007ffff58410ba in visit::walk_mod::h31802ca0457d14bar::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#44 0x00007ffff5840de1 in visit::Visitor::visit_mod::h1a5c2e2e645974aq::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#45 0x00007ffff5840d52 in visit::walk_crate::h57a183286ea062b4ap::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#46 0x00007ffff58408bc in rustc::middle::const_eval::process_crate () at src/librustc/middle/const_eval.rs:287
#47 0x00007ffff5bc28f7 in fn104129 () at src/librustc/driver/driver.rs:262
#48 0x00007ffff564f30d in rustc::util::common::time&lt;(),()&gt; () at src/librustc/util/common.rs:21
#49 0x00007ffff5bc0372 in rustc::driver::driver::phase_3_run_analysis_passes ()
    at src/librustc/driver/driver.rs:262
#50 0x00007ffff5bc629c in rustc::driver::driver::compile_input () at src/librustc/driver/driver.rs:442
#51 0x00007ffff5c106b4 in rustc::run_compiler () at src/librustc/rustc.rs:288
#52 0x00007ffff5c44805 in fn108099 () at src/librustc/rustc.rs:408
#53 0x00007ffff5c40c67 in fn108021 () at src/librustc/rustc.rs:367
#54 0x00007ffff5c38eca in task::TaskBuilder::try::anon::expr_fn::_7naSaB () at src/librustc/rustc.rs:349
#55 0x00007ffff752bb97 in fn42662 () at src/libstd/task/spawn.rs:587
#56 0x00007ffff7611f2f in fn49538 () at src/libstd/rt/task.rs:412
#57 0x00007ffff74cb51c in std::unstable::finally::Finally$__extensions__::finally ()
    at src/libstd/unstable/finally.rs:53
#58 0x00007ffff760ed73 in fn49466 () at src/libstd/rt/task.rs:275
#59 0x00007ffff761245d in std::rt::task::Unwinder::try::try_fn () at src/libstd/rt/task.rs:460
#60 0x00007ffff76123c7 in rt::task::Unwinder::try::try_fn::h917a6157155e2cnCaR::v0.9$x2dpre ()
    at src/libstd/rt/task.rs:460
#61 0x00007ffff2ffe9a4 in rust_try (f=&lt;optimized out&gt;, fptr=&lt;optimized out&gt;, env=&lt;optimized out&gt;)
    at /home/rust/rust/src/rt/rust_builtin.cpp:523
#62 0x00007ffff760ec2c in std::rt::task::Unwinder::try () at src/libstd/rt/task.rs:449
#63 0x00007ffff760eade in std::rt::task::Task::run () at src/libstd/rt/task.rs:275
#64 0x00007ffff7611bab in fn49531 () at src/libstd/rt/task.rs:412
#65 0x00007ffff76f2b4d in std::rt::context::Context::new::task_start_wrapper () at src/libstd/rt/context.rs:52
#66 0x00007ffff76f2af7 in rt::context::Context::new::task_start_wrapper::h1b9fdc38dc3bcfa4eta0::v0.9$x2dpre ()
    at src/libstd/rt/context.rs:52
#67 0x0000000000000000 in ?? ()"><pre class="notranslate"><code class="notranslate">#0  0x00007ffff1e5fe60 in __cxa_throw () from /usr/lib/libstdc++.so.6
#1  0x00007ffff2ffea2a in rust_begin_unwind (token=839147) at /home/rust/rust/src/rt/rust_builtin.cpp:533
#2  0x00007ffff7612586 in std::rt::task::Unwinder::begin_unwind () at src/libstd/rt/task.rs:477
#3  0x00007ffff75b8925 in std::rt::task::begin_unwind () at src/libstd/rt/task.rs:612
#4  0x00007ffff75b8a33 in fn46407 () at src/libstd/sys.rs:40
#5  0x00007ffff75b7e09 in fn46394 () at src/libstd/c_str.rs:307
#6  0x00007ffff75b7d5b in std::vec::MutableVector$__extensions__::as_mut_buf&lt;u8&gt; () at src/libstd/vec.rs:2017
#7  0x00007ffff75b7b45 in std::c_str::with_c_str&lt;!&gt; () at src/libstd/c_str.rs:307
#8  0x00007ffff75b7939 in std::c_str::ToCStr$__extensions__::with_c_str&lt;!&gt; () at src/libstd/c_str.rs:287
#9  0x00007ffff75b7897 in std::c_str::ToCStr$__extensions__::with_c_str&lt;!&gt; () at src/libstd/c_str.rs:249
#10 0x00007ffff75b89b1 in fn46404 () at src/libstd/sys.rs:40
#11 0x00007ffff75b7e09 in fn46394 () at src/libstd/c_str.rs:307
#12 0x00007ffff75b7d5b in std::vec::MutableVector$__extensions__::as_mut_buf&lt;u8&gt; () at src/libstd/vec.rs:2017
#13 0x00007ffff75b7b45 in std::c_str::with_c_str&lt;!&gt; () at src/libstd/c_str.rs:307
#14 0x00007ffff75b7939 in std::c_str::ToCStr$__extensions__::with_c_str&lt;!&gt; () at src/libstd/c_str.rs:287
#15 0x00007ffff75b7897 in std::c_str::ToCStr$__extensions__::with_c_str&lt;!&gt; () at src/libstd/c_str.rs:249
#16 0x00007ffff7482ecd in std::sys::FailWithCause$__extensions__::fail_with () at src/libstd/sys.rs:40
#17 0x00007ffff64f7348 in syntax::diagnostic::handler$HandlerT::fatal () at src/libsyntax/diagnostic.rs:29
#18 0x00007ffff64f82d9 in syntax::diagnostic::handler$HandlerT::bug () at src/libsyntax/diagnostic.rs:135
#19 0x00007ffff4e8abcb in rustc::driver::session::Session_::bug () at src/librustc/driver/session.rs:256
#20 0x00007ffff4e8cf57 in rustc::middle::ty::node_id_to_type () at src/librustc/middle/ty.rs:2799
#21 0x00007ffff5072738 in rustc::middle::ty::expr_ty () at src/librustc/middle/ty.rs:2960
#22 0x00007ffff583db8b in rustc::middle::const_eval::ConstEvalVisitor::lookup_constness ()
    at src/librustc/middle/const_eval.rs:262
#23 0x00007ffff583bec3 in rustc::middle::const_eval::ConstEvalVisitor::classify ()
    at src/librustc/middle/const_eval.rs:249
#24 0x00007ffff58407a7 in rustc::middle::const_eval::Visitor$ConstEvalVisitor::visit_expr_post ()
    at src/librustc/middle/const_eval.rs:277
#25 0x00007ffff5845404 in visit::walk_expr::hfa295b274c17508aay::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#26 0x00007ffff5842268 in visit::Visitor::visit_expr::h1a24411352624b7ax::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#27 0x00007ffff5845628 in visit::walk_exprs::h1467dd839791d97aaz::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#28 0x00007ffff5843b98 in visit::walk_expr::hfa295b274c17508aay::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#29 0x00007ffff5842268 in visit::Visitor::visit_expr::h1a24411352624b7ax::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#30 0x00007ffff5843db7 in visit::walk_expr::hfa295b274c17508aay::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#31 0x00007ffff5842268 in visit::Visitor::visit_expr::h1a24411352624b7ax::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#32 0x00007ffff5844102 in visit::walk_expr::hfa295b274c17508aay::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#33 0x00007ffff5842268 in visit::Visitor::visit_expr::h1a24411352624b7ax::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#34 0x00007ffff5845f18 in visit::walk_stmt::hee2bec38e02f8aaF::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#35 0x00007ffff5845d52 in visit::Visitor::visit_stmt::hb94918db37abda88aE::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#36 0x00007ffff5845c91 in visit::walk_block::h4984e27ce75811daD::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#37 0x00007ffff58459fa in visit::Visitor::visit_block::h7e3e6d1942d24c33aC::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#38 0x00007ffff5847e10 in visit::walk_fn::h9fa0431031d49545aR::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#39 0x00007ffff5847bff in visit::Visitor::visit_fn::h93d4aa2ed2db35aeaQ::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#40 0x00007ffff5848f5b in visit::walk_method_helper::hfc8bf51419c0129aa4::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#41 0x00007ffff5841e9c in visit::walk_item::hda6dd8554fcbf892av::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#42 0x00007ffff5841212 in visit::Visitor::visit_item::h7ca8716289d5d081au::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#43 0x00007ffff58410ba in visit::walk_mod::h31802ca0457d14bar::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#44 0x00007ffff5840de1 in visit::Visitor::visit_mod::h1a5c2e2e645974aq::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#45 0x00007ffff5840d52 in visit::walk_crate::h57a183286ea062b4ap::v0.9$x2dpre ()
    at src/librustc/middle/const_eval.rs:287
#46 0x00007ffff58408bc in rustc::middle::const_eval::process_crate () at src/librustc/middle/const_eval.rs:287
#47 0x00007ffff5bc28f7 in fn104129 () at src/librustc/driver/driver.rs:262
#48 0x00007ffff564f30d in rustc::util::common::time&lt;(),()&gt; () at src/librustc/util/common.rs:21
#49 0x00007ffff5bc0372 in rustc::driver::driver::phase_3_run_analysis_passes ()
    at src/librustc/driver/driver.rs:262
#50 0x00007ffff5bc629c in rustc::driver::driver::compile_input () at src/librustc/driver/driver.rs:442
#51 0x00007ffff5c106b4 in rustc::run_compiler () at src/librustc/rustc.rs:288
#52 0x00007ffff5c44805 in fn108099 () at src/librustc/rustc.rs:408
#53 0x00007ffff5c40c67 in fn108021 () at src/librustc/rustc.rs:367
#54 0x00007ffff5c38eca in task::TaskBuilder::try::anon::expr_fn::_7naSaB () at src/librustc/rustc.rs:349
#55 0x00007ffff752bb97 in fn42662 () at src/libstd/task/spawn.rs:587
#56 0x00007ffff7611f2f in fn49538 () at src/libstd/rt/task.rs:412
#57 0x00007ffff74cb51c in std::unstable::finally::Finally$__extensions__::finally ()
    at src/libstd/unstable/finally.rs:53
#58 0x00007ffff760ed73 in fn49466 () at src/libstd/rt/task.rs:275
#59 0x00007ffff761245d in std::rt::task::Unwinder::try::try_fn () at src/libstd/rt/task.rs:460
#60 0x00007ffff76123c7 in rt::task::Unwinder::try::try_fn::h917a6157155e2cnCaR::v0.9$x2dpre ()
    at src/libstd/rt/task.rs:460
#61 0x00007ffff2ffe9a4 in rust_try (f=&lt;optimized out&gt;, fptr=&lt;optimized out&gt;, env=&lt;optimized out&gt;)
    at /home/rust/rust/src/rt/rust_builtin.cpp:523
#62 0x00007ffff760ec2c in std::rt::task::Unwinder::try () at src/libstd/rt/task.rs:449
#63 0x00007ffff760eade in std::rt::task::Task::run () at src/libstd/rt/task.rs:275
#64 0x00007ffff7611bab in fn49531 () at src/libstd/rt/task.rs:412
#65 0x00007ffff76f2b4d in std::rt::context::Context::new::task_start_wrapper () at src/libstd/rt/context.rs:52
#66 0x00007ffff76f2af7 in rt::context::Context::new::task_start_wrapper::h1b9fdc38dc3bcfa4eta0::v0.9$x2dpre ()
    at src/libstd/rt/context.rs:52
#67 0x0000000000000000 in ?? ()
</code></pre></div>
<p dir="auto">rustc version: <code class="notranslate">rustc 0.9-pre (950add4 2013-10-26 02:16:08 -0700)</code></p>
<p dir="auto">Host OS: Arch Linux x86_64</p>
<p dir="auto">Sorry for no isolated test case, error appears when compiling a 500ish line source file and I have no idea what is triggering the issue.</p>