rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.57k stars 12.74k forks source link

ICE: called `Option::unwrap()` on a `None` value #115658

Closed benluelo closed 10 months ago

benluelo commented 1 year ago

Code

I have been unable to reproduce this; I was in the middle of a large refactor to our traits and I'm honestly not sure what the issue is. Figured I'd dump this anyways in case it's useful to anyone!

We are using #![feature(return_position_impl_trait_in_trait)].

Meta

rustc --version --verbose:

rustc 1.74.0-nightly (734a0d0aa 2023-08-25)
binary: rustc
commit-hash: 734a0d0aa0d5cab60f94f6d0c6a014dae12915f1
commit-date: 2023-08-25
host: x86_64-unknown-linux-gnu
release: 1.74.0-nightly
LLVM version: 17.0.0

Error output

See comment above, unable to reproduce :pensive:

Backtrace

``` called `Option::unwrap()` on a `None` value stack backtrace: 0: 0x7ffff391330c - std::backtrace_rs::backtrace::libunwind::trace::hd9f7ac08238d25ac at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5 1: 0x7ffff391330c - std::backtrace_rs::backtrace::trace_unsynchronized::h1af01762a2621c85 at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x7ffff391330c - std::sys_common::backtrace::_print_fmt::h5f3b8dbcedc37939 at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/std/src/sys_common/backtrace.rs:67:5 3: 0x7ffff391330c - ::fmt::he6380ff20810e388 at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/std/src/sys_common/backtrace.rs:44:22 4: 0x7ffff39794bc - core::fmt::rt::Argument::fmt::h6efc876ec995b0df at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/core/src/fmt/rt.rs:138:9 5: 0x7ffff39794bc - core::fmt::write::hbfff067b75f69c18 at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/core/src/fmt/mod.rs:1094:21 6: 0x7ffff3905d3e - std::io::Write::write_fmt::h28ddc294557b6a5d at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/std/src/io/mod.rs:1714:15 7: 0x7ffff39130f4 - std::sys_common::backtrace::_print::h58b8061724e09bea at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/std/src/sys_common/backtrace.rs:47:5 8: 0x7ffff39130f4 - std::sys_common::backtrace::print::hf2c5a771029da8c3 at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/std/src/sys_common/backtrace.rs:34:9 9: 0x7ffff39161ea - std::panicking::panic_hook_with_disk_dump::{{closure}}::h3dfc347c2ae051bf at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/std/src/panicking.rs:278:22 10: 0x7ffff3915e9a - std::panicking::panic_hook_with_disk_dump::h15cbef431cdd8a7c at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/std/src/panicking.rs:305:9 11: 0x7ffff6b52029 - rustc_driver_impl[ef6a0d9a5572f1d2]::install_ice_hook::{closure#0} 12: 0x7ffff3916a91 - as core::ops::function::Fn>::call::hefa73e6727dbd05e at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/alloc/src/boxed.rs:2021:9 13: 0x7ffff3916a91 - std::panicking::rust_panic_with_hook::ha11958324ac326da at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/std/src/panicking.rs:733:13 14: 0x7ffff39167d1 - std::panicking::begin_panic_handler::{{closure}}::h25628dd6d458ebc5 at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/std/src/panicking.rs:619:13 15: 0x7ffff3913836 - std::sys_common::backtrace::__rust_end_short_backtrace::h2a57751d7b8147f4 at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/std/src/sys_common/backtrace.rs:170:18 16: 0x7ffff3916562 - rust_begin_unwind at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/std/src/panicking.rs:617:5 17: 0x7ffff39758a3 - core::panicking::panic_fmt::h65cee700c969655b at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/core/src/panicking.rs:67:14 18: 0x7ffff3975933 - core::panicking::panic::h6631890b18b04c1c at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/core/src/panicking.rs:117:5 19: 0x7ffff4fdb317 - ::to_place 20: 0x7ffff4fcdaaf - ::expr_into_dest 21: 0x7ffff4fc71e1 - ::as_temp_inner 22: 0x7ffff4fdf56d - ::as_operand 23: 0x7ffff4fd6d8d - ::as_call_operand 24: 0x7ffff4fd7736 - ::as_call_operand 25: 0x7ffff4fcddae - ::expr_into_dest 26: 0x7ffff4fc71e1 - ::as_temp_inner 27: 0x7ffff4fdf56d - ::as_operand 28: 0x7ffff4fd6d8d - ::as_call_operand 29: 0x7ffff4fd7736 - ::as_call_operand 30: 0x7ffff4fcddae - ::expr_into_dest 31: 0x7ffff4fc71e1 - ::as_temp_inner 32: 0x7ffff4fdf56d - ::as_operand 33: 0x7ffff4fd6d8d - ::as_call_operand 34: 0x7ffff4fd7736 - ::as_call_operand 35: 0x7ffff4fcddae - ::expr_into_dest 36: 0x7ffff4fc71e1 - ::as_temp_inner 37: 0x7ffff4fe51ad - ::expr_as_place 38: 0x7ffff4fe5ad0 - ::expr_as_place 39: 0x7ffff4fcf1d7 - ::expr_into_dest 40: 0x7ffff4fc71e1 - ::as_temp_inner 41: 0x7ffff4fdf56d - ::as_operand 42: 0x7ffff4fd6d8d - ::as_call_operand 43: 0x7ffff4fd7736 - ::as_call_operand 44: 0x7ffff4fcddae - ::expr_into_dest 45: 0x7ffff4fc71e1 - ::as_temp_inner 46: 0x7ffff4fe51ad - ::expr_as_place 47: 0x7ffff4fceceb - ::expr_into_dest 48: 0x7ffff4fc71e1 - ::as_temp_inner 49: 0x7ffff4fdf56d - ::as_operand 50: 0x7ffff4fd6d8d - ::as_call_operand 51: 0x7ffff4fd7736 - ::as_call_operand 52: 0x7ffff4fcddae - ::expr_into_dest 53: 0x7ffff4fc71e1 - ::as_temp_inner 54: 0x7ffff4fdf56d - ::as_operand 55: 0x7ffff4fd6d8d - ::as_call_operand 56: 0x7ffff4fd7736 - ::as_call_operand 57: 0x7ffff4fcddae - ::expr_into_dest 58: 0x7ffff4fc71e1 - ::as_temp_inner 59: 0x7ffff4fe51ad - ::expr_as_place 60: 0x7ffff4fe5ad0 - ::expr_as_place 61: 0x7ffff4fcf1d7 - ::expr_into_dest 62: 0x7ffff4fc71e1 - ::as_temp_inner 63: 0x7ffff4fdf56d - ::as_operand 64: 0x7ffff4fd6d8d - ::as_call_operand 65: 0x7ffff4fd7736 - ::as_call_operand 66: 0x7ffff4fcddae - ::expr_into_dest 67: 0x7ffff4fc71e1 - ::as_temp_inner 68: 0x7ffff4fdf56d - ::as_operand 69: 0x7ffff4fd6d8d - ::as_call_operand 70: 0x7ffff4fd7736 - ::as_call_operand 71: 0x7ffff4fcddae - ::expr_into_dest 72: 0x7ffff4fc71e1 - ::as_temp_inner 73: 0x7ffff4fe51ad - ::expr_as_place 74: 0x7ffff4fe5ad0 - ::expr_as_place 75: 0x7ffff4fe5741 - ::expr_as_place 76: 0x7ffff4fd0bcc - ::expr_into_dest 77: 0x7ffff4fc71e1 - ::as_temp_inner 78: 0x7ffff4fdf56d - ::as_operand 79: 0x7ffff4fd6d8d - ::as_call_operand 80: 0x7ffff4fd7736 - ::as_call_operand 81: 0x7ffff4fcddae - ::expr_into_dest 82: 0x7ffff4fc71e1 - ::as_temp_inner 83: 0x7ffff4fdf56d - ::as_operand 84: 0x7ffff4fd6d8d - ::as_call_operand 85: 0x7ffff4fd7736 - ::as_call_operand 86: 0x7ffff4fcddae - ::expr_into_dest 87: 0x7ffff4fc71e1 - ::as_temp_inner 88: 0x7ffff4fdf56d - ::as_operand 89: 0x7ffff4fd6d8d - ::as_call_operand 90: 0x7ffff4fd7736 - ::as_call_operand 91: 0x7ffff4fcddae - ::expr_into_dest 92: 0x7ffff4fcff98 - ::expr_into_dest 93: 0x7ffff4ff91db - ::ast_block_stmts 94: 0x7ffff4fed498 - ::ast_block 95: 0x7ffff4fce142 - ::expr_into_dest 96: 0x7ffff4fcff98 - ::expr_into_dest 97: 0x7ffff4fcff98 - ::expr_into_dest 98: 0x7ffff5ad9499 - rustc_mir_build[9f1c573e007d91ab]::build::mir_built 99: 0x7ffff4c3a44c - rustc_query_impl[7e9da624c7438cfe]::plumbing::__rust_begin_short_backtrace::> 100: 0x7ffff4c3a42e - >::call_once 101: 0x7ffff52a46e0 - rustc_query_system[f97f1b1c716e5ed3]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[7e9da624c7438cfe]::plumbing::QueryCtxt, true> 102: 0x7ffff64bbd3e - rustc_query_impl[7e9da624c7438cfe]::query_impl::mir_built::get_query_incr::__rust_end_short_backtrace 103: 0x7ffff5d1aa7c - rustc_mir_transform[a0b36c39e6d8201b]::check_unsafety::unsafety_check_result 104: 0x7ffff4c3a48c - rustc_query_impl[7e9da624c7438cfe]::plumbing::__rust_begin_short_backtrace::> 105: 0x7ffff4c3a46e - >::call_once 106: 0x7ffff52a46e0 - rustc_query_system[f97f1b1c716e5ed3]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[7e9da624c7438cfe]::plumbing::QueryCtxt, true> 107: 0x7ffff64c26be - rustc_query_impl[7e9da624c7438cfe]::query_impl::unsafety_check_result::get_query_incr::__rust_end_short_backtrace 108: 0x7ffff5d1ddc3 - rustc_mir_transform[a0b36c39e6d8201b]::check_unsafety::unsafety_check_result 109: 0x7ffff4c3a48c - rustc_query_impl[7e9da624c7438cfe]::plumbing::__rust_begin_short_backtrace::> 110: 0x7ffff4c3a46e - >::call_once 111: 0x7ffff52a46e0 - rustc_query_system[f97f1b1c716e5ed3]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[7e9da624c7438cfe]::plumbing::QueryCtxt, true> 112: 0x7ffff64c26be - rustc_query_impl[7e9da624c7438cfe]::query_impl::unsafety_check_result::get_query_incr::__rust_end_short_backtrace 113: 0x7ffff5f4b2aa - rustc_mir_transform[a0b36c39e6d8201b]::mir_const 114: 0x7ffff4c5417e - rustc_query_impl[7e9da624c7438cfe]::plumbing::__rust_begin_short_backtrace::> 115: 0x7ffff4c5414e - >::call_once 116: 0x7ffff52a46e0 - rustc_query_system[f97f1b1c716e5ed3]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[7e9da624c7438cfe]::plumbing::QueryCtxt, true> 117: 0x7ffff64bc0ae - rustc_query_impl[7e9da624c7438cfe]::query_impl::mir_const::get_query_incr::__rust_end_short_backtrace 118: 0x7ffff4e13891 - rustc_mir_transform[a0b36c39e6d8201b]::mir_promoted 119: 0x7ffff4c2ea41 - rustc_query_impl[7e9da624c7438cfe]::plumbing::__rust_begin_short_backtrace::> 120: 0x7ffff5feaee3 - rustc_query_system[f97f1b1c716e5ed3]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[7e9da624c7438cfe]::plumbing::QueryCtxt, true> 121: 0x7ffff64bcca1 - rustc_query_impl[7e9da624c7438cfe]::query_impl::mir_promoted::get_query_incr::__rust_end_short_backtrace 122: 0x7ffff5896493 - rustc_borrowck[efb40d028f95635c]::mir_borrowck 123: 0x7ffff4c5411e - rustc_query_impl[7e9da624c7438cfe]::plumbing::__rust_begin_short_backtrace::> 124: 0x7ffff4c540ee - >::call_once 125: 0x7ffff52a46e0 - rustc_query_system[f97f1b1c716e5ed3]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[7e9da624c7438cfe]::plumbing::QueryCtxt, true> 126: 0x7ffff64c63ee - rustc_query_impl[7e9da624c7438cfe]::query_impl::mir_borrowck::get_query_incr::__rust_end_short_backtrace 127: 0x7ffff54e1999 - rustc_hir_analysis[37a30d08878fd5d]::collect::type_of::opaque::find_opaque_ty_constraints_for_rpit 128: 0x7ffff54dd5e9 - rustc_hir_analysis[37a30d08878fd5d]::collect::type_of::type_of 129: 0x7ffff4decdab - rustc_query_impl[7e9da624c7438cfe]::plumbing::__rust_begin_short_backtrace::> 130: 0x7ffff4decd70 - >::call_once 131: 0x7ffff56ced0d - rustc_query_system[f97f1b1c716e5ed3]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[7e9da624c7438cfe]::plumbing::QueryCtxt, true> 132: 0x7ffff64b8df5 - rustc_query_impl[7e9da624c7438cfe]::query_impl::type_of::get_query_incr::__rust_end_short_backtrace 133: 0x7ffff599ac96 - rustc_middle[99297203a9599a56]::query::plumbing::query_get_at::>> 134: 0x7ffff599495b - rustc_hir_analysis[37a30d08878fd5d]::check::check::check_mod_item_types 135: 0x7ffff58824fc - rustc_query_impl[7e9da624c7438cfe]::plumbing::__rust_begin_short_backtrace::> 136: 0x7ffff58824de - >::call_once 137: 0x7ffff61ac7fb - rustc_query_system[f97f1b1c716e5ed3]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[7e9da624c7438cfe]::plumbing::QueryCtxt, true> 138: 0x7ffff64c4408 - rustc_query_impl[7e9da624c7438cfe]::query_impl::check_mod_item_types::get_query_incr::__rust_end_short_backtrace 139: 0x7ffff5ac0da7 - ::for_each_module:: 140: 0x7ffff5abf9ec - rustc_hir_analysis[37a30d08878fd5d]::check_crate 141: 0x7ffff5ab8efa - rustc_interface[219b97010207cb3]::passes::analysis 142: 0x7ffff60597ca - rustc_query_impl[7e9da624c7438cfe]::plumbing::__rust_begin_short_backtrace::> 143: 0x7ffff60597b9 - >::call_once 144: 0x7ffff6334928 - rustc_query_system[f97f1b1c716e5ed3]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[7e9da624c7438cfe]::plumbing::QueryCtxt, true> 145: 0x7ffff6334484 - rustc_query_impl[7e9da624c7438cfe]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace 146: 0x7ffff5e218a6 - ::enter::> 147: 0x7ffff5e20d2c - ::enter::, rustc_span[bbf7b08c8648562e]::ErrorGuaranteed>> 148: 0x7ffff5e1e048 - std[f6dab3b182b9be26]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[ef6a0d9a5572f1d2]::run_compiler::{closure#1}>::{closure#0}, core[d6db75e283dce156]::result::Result<(), rustc_span[bbf7b08c8648562e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d6db75e283dce156]::result::Result<(), rustc_span[bbf7b08c8648562e]::ErrorGuaranteed>> 149: 0x7ffff63c8525 - <::spawn_unchecked_, rustc_driver_impl[ef6a0d9a5572f1d2]::run_compiler::{closure#1}>::{closure#0}, core[d6db75e283dce156]::result::Result<(), rustc_span[bbf7b08c8648562e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d6db75e283dce156]::result::Result<(), rustc_span[bbf7b08c8648562e]::ErrorGuaranteed>>::{closure#1} as core[d6db75e283dce156]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 150: 0x7ffff39213f5 - as core::ops::function::FnOnce>::call_once::h13a8377f793e536e at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/alloc/src/boxed.rs:2007:9 151: 0x7ffff39213f5 - as core::ops::function::FnOnce>::call_once::hb5e362578b76df77 at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/alloc/src/boxed.rs:2007:9 152: 0x7ffff39213f5 - std::sys::unix::thread::Thread::new::thread_start::h9411d5912fbb349b at /rustc/734a0d0aa0d5cab60f94f6d0c6a014dae12915f1/library/std/src/sys/unix/thread.rs:108:17 153: 0x7ffff36b4dd4 - start_thread 154: 0x7ffff37369b0 - __clone3 155: 0x0 - rustc version: 1.74.0-nightly (734a0d0aa 2023-08-25) platform: x86_64-unknown-linux-gnu query stack during panic: #0 [mir_built] building MIR for `chain::cosmos::::query_client_state::{closure#0}` #1 [unsafety_check_result] unsafety-checking `chain::cosmos::::query_client_state::{closure#0}` #2 [unsafety_check_result] unsafety-checking `chain::cosmos::::query_client_state` #3 [mir_const] preparing `chain::cosmos::::query_client_state` for borrow checking #4 [mir_promoted] promoting constants in MIR for `chain::cosmos::::query_client_state` #5 [mir_borrowck] borrow-checking `chain::cosmos::::query_client_state` #6 [type_of] computing type of `chain::cosmos::::query_client_state::{opaque#0}` #7 [check_mod_item_types] checking item types in module `chain::cosmos` #8 [analysis] running analysis passes on this crate end of query stack ```

compiler-errors commented 1 year ago

Yeah, it's pretty much impossible to fix this or do anything actionable with this issue unless you can share some code :sweat:

kpreid commented 10 months ago

Nothing to minimize, so not E-needs-mcve. @rustbot label -E-needs-mcve