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

MIR panic during cross-chain queries #122083

Closed Twey closed 8 months ago

Twey commented 8 months ago

I ran into an ICE while building a large codebase in an invalid state with Rust 1.75.0.

Unfortunately I don't have time to make a minimal example right now, but I thought it might be worth putting the stack trace here anyway in case it's sufficiently informative!

Code

I've published the state of the code that triggered the ICE at https://github.com/Twey/linera-protocol/tree/03-06-ICE. I triggered it by simply running cargo build.

Meta

rustc --version --verbose:

$ rustc --version --verbose
rustc 1.75.0 (82e1608df 2023-12-21)
binary: rustc
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
commit-date: 2023-12-21
host: x86_64-unknown-linux-gnu
release: 1.75.0
LLVM version: 17.0.6

Error output

thread 'rustc' panicked at compiler/rustc_mir_build/src/build/expr/as_place.rs:253:31:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:     0x7f801ef6362c - std::backtrace_rs::backtrace::libunwind::trace::ha637c64ce894333a
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f801ef6362c - std::backtrace_rs::backtrace::trace_unsynchronized::h47f62dea28e0c88d
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f801ef6362c - std::sys_common::backtrace::_print_fmt::h9eef0abe20ede486
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f801ef6362c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hed7f999df88cc644
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f801efb6630 - core::fmt::rt::Argument::fmt::h1539a9308b8d058d
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/fmt/rt.rs:142:9
   5:     0x7f801efb6630 - core::fmt::write::h3a39390d8560d9c9
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f801ef5754f - std::io::Write::write_fmt::h5fc9997dfe05f882
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/io/mod.rs:1762:15
   7:     0x7f801ef63414 - std::sys_common::backtrace::_print::h894006fb5c6f3d45
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f801ef63414 - std::sys_common::backtrace::print::h23a2d212c6fff936
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f801ef660a7 - std::panicking::default_hook::{{closure}}::h8a1d2ee00185001a
  10:     0x7f801ef65e0f - std::panicking::default_hook::h6038f2eba384e475
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:292:9
  11:     0x7f8021b37190 - std[409886f6357001f0]::panicking::update_hook::<alloc[c1b021ad36e35877]::boxed::Box<rustc_driver_impl[7d23c5715ff089db]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f801ef667e8 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h1f8f335eaa9cfaee
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/boxed.rs:2021:9
  13:     0x7f801ef667e8 - std::panicking::rust_panic_with_hook::h2b5517d590cab22e
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:783:13
  14:     0x7f801ef66509 - std::panicking::begin_panic_handler::{{closure}}::h233112c06e0ef43e
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:649:13
  15:     0x7f801ef63af6 - std::sys_common::backtrace::__rust_end_short_backtrace::h6e893f24d7ebbff8
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:170:18
  16:     0x7f801ef662a2 - rust_begin_unwind
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:645:5
  17:     0x7f801efb2d15 - core::panicking::panic_fmt::hbf0e066aabfa482c
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:72:14
  18:     0x7f801efb2db3 - core::panicking::panic::h195fc2a96298d4c3
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:127:5
  19:     0x7f80235fe3a8 - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::expr_into_dest
  20:     0x7f8022ea8592 - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::as_temp::{closure#0}
  21:     0x7f8022ea539a - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::as_operand
  22:     0x7f8023340017 - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::as_call_operand
  23:     0x7f80233408c5 - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::as_call_operand
  24:     0x7f80235f6a75 - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::expr_into_dest
  25:     0x7f8022ea8592 - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::as_temp::{closure#0}
  26:     0x7f8022ea539a - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::as_operand
  27:     0x7f8023340017 - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::as_call_operand
  28:     0x7f80233408c5 - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::as_call_operand
  29:     0x7f80235f6a75 - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::expr_into_dest
  30:     0x7f8022ea8592 - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::as_temp::{closure#0}
  31:     0x7f8022ea539a - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::as_operand
  32:     0x7f8023340017 - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::as_call_operand
  33:     0x7f80233408c5 - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::as_call_operand
  34:     0x7f80235f6a75 - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::expr_into_dest
  35:     0x7f8022ea8592 - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::as_temp::{closure#0}
  36:     0x7f8023043395 - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::expr_as_place
  37:     0x7f8023043945 - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::expr_as_place
  38:     0x7f80235f806e - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::expr_into_dest
  39:     0x7f80235f884d - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::expr_into_dest
  40:     0x7f8020330be9 - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::ast_block_stmts
  41:     0x7f80235f6f88 - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::expr_into_dest
  42:     0x7f80235f884d - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::expr_into_dest
  43:     0x7f80235f884d - <rustc_mir_build[2c436e1ea0383028]::build::Builder>::expr_into_dest
  44:     0x7f8023343d21 - rustc_mir_build[2c436e1ea0383028]::build::mir_build::{closure#0}
  45:     0x7f80230f5efc - rustc_mir_build[2c436e1ea0383028]::build::mir_built
  46:     0x7f80230f5bed - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>
  47:     0x7f80234bf561 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::VecCache<rustc_span[3d5dc97049ad8d50]::def_id::LocalDefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, true>
  48:     0x7f80234bd2ba - rustc_query_impl[664ae873a521fa7c]::query_impl::mir_built::get_query_incr::__rust_end_short_backtrace
  49:     0x7f8020484f5e - rustc_mir_transform[c2283c4a1a7a7523]::check_unsafety::unsafety_check_result
  50:     0x7f8022f057c7 - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>
  51:     0x7f80234bf561 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::VecCache<rustc_span[3d5dc97049ad8d50]::def_id::LocalDefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, true>
  52:     0x7f80234bd67a - rustc_query_impl[664ae873a521fa7c]::query_impl::unsafety_check_result::get_query_incr::__rust_end_short_backtrace
  53:     0x7f80204886ab - rustc_mir_transform[c2283c4a1a7a7523]::check_unsafety::unsafety_check_result
  54:     0x7f8022f057c7 - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>
  55:     0x7f80234bf561 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::VecCache<rustc_span[3d5dc97049ad8d50]::def_id::LocalDefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, true>
  56:     0x7f80234bd67a - rustc_query_impl[664ae873a521fa7c]::query_impl::unsafety_check_result::get_query_incr::__rust_end_short_backtrace
  57:     0x7f80204886ab - rustc_mir_transform[c2283c4a1a7a7523]::check_unsafety::unsafety_check_result
  58:     0x7f8022f057c7 - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>
  59:     0x7f80234bf561 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::VecCache<rustc_span[3d5dc97049ad8d50]::def_id::LocalDefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, true>
  60:     0x7f80234bd67a - rustc_query_impl[664ae873a521fa7c]::query_impl::unsafety_check_result::get_query_incr::__rust_end_short_backtrace
  61:     0x7f80204886ab - rustc_mir_transform[c2283c4a1a7a7523]::check_unsafety::unsafety_check_result
  62:     0x7f8022f057c7 - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>
  63:     0x7f80234bf561 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::VecCache<rustc_span[3d5dc97049ad8d50]::def_id::LocalDefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, true>
  64:     0x7f80234bd67a - rustc_query_impl[664ae873a521fa7c]::query_impl::unsafety_check_result::get_query_incr::__rust_end_short_backtrace
  65:     0x7f80204886ab - rustc_mir_transform[c2283c4a1a7a7523]::check_unsafety::unsafety_check_result
  66:     0x7f8022f057c7 - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>
  67:     0x7f80234bf561 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::VecCache<rustc_span[3d5dc97049ad8d50]::def_id::LocalDefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, true>
  68:     0x7f80234bd67a - rustc_query_impl[664ae873a521fa7c]::query_impl::unsafety_check_result::get_query_incr::__rust_end_short_backtrace
  69:     0x7f80204886ab - rustc_mir_transform[c2283c4a1a7a7523]::check_unsafety::unsafety_check_result
  70:     0x7f8022f057c7 - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>
  71:     0x7f80234bf561 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::VecCache<rustc_span[3d5dc97049ad8d50]::def_id::LocalDefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, true>
  72:     0x7f80234bd67a - rustc_query_impl[664ae873a521fa7c]::query_impl::unsafety_check_result::get_query_incr::__rust_end_short_backtrace
  73:     0x7f80204886ab - rustc_mir_transform[c2283c4a1a7a7523]::check_unsafety::unsafety_check_result
  74:     0x7f8022f057c7 - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>
  75:     0x7f80234bf561 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::VecCache<rustc_span[3d5dc97049ad8d50]::def_id::LocalDefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, true>
  76:     0x7f80234bd67a - rustc_query_impl[664ae873a521fa7c]::query_impl::unsafety_check_result::get_query_incr::__rust_end_short_backtrace
  77:     0x7f802328e99a - rustc_mir_transform[c2283c4a1a7a7523]::mir_const
  78:     0x7f802328e8ed - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::mir_const::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>
  79:     0x7f80234bf561 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::VecCache<rustc_span[3d5dc97049ad8d50]::def_id::LocalDefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, true>
  80:     0x7f80234bd3bc - rustc_query_impl[664ae873a521fa7c]::query_impl::mir_const::get_query_incr::__rust_end_short_backtrace
  81:     0x7f80211474a6 - rustc_mir_transform[c2283c4a1a7a7523]::mir_promoted
  82:     0x7f802330e352 - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::mir_promoted::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 16usize]>>
  83:     0x7f8023b6fe30 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::VecCache<rustc_span[3d5dc97049ad8d50]::def_id::LocalDefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, true>
  84:     0x7f8023b70ec9 - rustc_query_impl[664ae873a521fa7c]::query_impl::mir_promoted::get_query_incr::__rust_end_short_backtrace
  85:     0x7f8023b70fe1 - rustc_borrowck[798173c66b163320]::mir_borrowck
  86:     0x7f8023b70f57 - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>
  87:     0x7f80234bf561 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::VecCache<rustc_span[3d5dc97049ad8d50]::def_id::LocalDefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, true>
  88:     0x7f802348d533 - rustc_query_impl[664ae873a521fa7c]::query_impl::mir_borrowck::get_query_incr::__rust_end_short_backtrace
  89:     0x7f8023a78cff - rustc_hir_analysis[eb447668a4654582]::collect::type_of::type_of_opaque
  90:     0x7f8023a78ac9 - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>
  91:     0x7f8023059f29 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::DefaultCache<rustc_span[3d5dc97049ad8d50]::def_id::DefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, true>
  92:     0x7f8023d30509 - rustc_query_impl[664ae873a521fa7c]::query_impl::type_of_opaque::get_query_incr::__rust_end_short_backtrace
  93:     0x7f802327cac0 - rustc_middle[aca4860da4e5a967]::query::plumbing::query_get_at::<rustc_query_system[b5dcdc06a735d5f1]::query::caches::DefaultCache<rustc_span[3d5dc97049ad8d50]::def_id::DefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>>
  94:     0x7f8020030c9d - <rustc_trait_selection[41fdcbe9af166e54]::traits::select::SelectionContext>::poly_select
  95:     0x7f801fffe348 - <rustc_trait_selection[41fdcbe9af166e54]::traits::fulfill::FulfillProcessor as rustc_data_structures[460c9a4ac96dfa1f]::obligation_forest::ObligationProcessor>::process_obligation
  96:     0x7f8022e10f15 - <rustc_data_structures[460c9a4ac96dfa1f]::obligation_forest::ObligationForest<rustc_trait_selection[41fdcbe9af166e54]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[41fdcbe9af166e54]::traits::fulfill::FulfillProcessor>
  97:     0x7f80237f616e - <rustc_hir_typeck[2eba1876834da1d1]::fn_ctxt::FnCtxt>::check_argument_types
  98:     0x7f80237ee94f - <rustc_hir_typeck[2eba1876834da1d1]::fn_ctxt::FnCtxt>::check_call
  99:     0x7f80238c0654 - <rustc_hir_typeck[2eba1876834da1d1]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
 100:     0x7f8023378599 - <rustc_hir_typeck[2eba1876834da1d1]::fn_ctxt::FnCtxt>::check_block_with_expected
 101:     0x7f80238c07a9 - <rustc_hir_typeck[2eba1876834da1d1]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
 102:     0x7f80238c1ef4 - <rustc_hir_typeck[2eba1876834da1d1]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
 103:     0x7f8023378659 - <rustc_hir_typeck[2eba1876834da1d1]::fn_ctxt::FnCtxt>::check_block_with_expected
 104:     0x7f80238c07a9 - <rustc_hir_typeck[2eba1876834da1d1]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
 105:     0x7f80235bb4fe - rustc_hir_typeck[2eba1876834da1d1]::check::check_fn
 106:     0x7f80236a1899 - <rustc_hir_typeck[2eba1876834da1d1]::fn_ctxt::FnCtxt>::check_expr_closure
 107:     0x7f80238c3f64 - <rustc_hir_typeck[2eba1876834da1d1]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
 108:     0x7f80235bb4fe - rustc_hir_typeck[2eba1876834da1d1]::check::check_fn
 109:     0x7f8023155353 - rustc_hir_typeck[2eba1876834da1d1]::typeck
 110:     0x7f80231547c7 - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>
 111:     0x7f80234bf561 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::VecCache<rustc_span[3d5dc97049ad8d50]::def_id::LocalDefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, true>
 112:     0x7f8023284a0b - rustc_query_impl[664ae873a521fa7c]::query_impl::typeck::get_query_incr::__rust_end_short_backtrace
 113:     0x7f8023a78bb3 - rustc_hir_analysis[eb447668a4654582]::collect::type_of::type_of_opaque
 114:     0x7f8023a78ac9 - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>
 115:     0x7f8023059f29 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::DefaultCache<rustc_span[3d5dc97049ad8d50]::def_id::DefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, true>
 116:     0x7f8023d30509 - rustc_query_impl[664ae873a521fa7c]::query_impl::type_of_opaque::get_query_incr::__rust_end_short_backtrace
 117:     0x7f8022f0a83b - rustc_middle[aca4860da4e5a967]::query::plumbing::query_get_at::<rustc_query_system[b5dcdc06a735d5f1]::query::caches::DefaultCache<rustc_span[3d5dc97049ad8d50]::def_id::DefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>>
 118:     0x7f80202d8638 - rustc_hir_analysis[eb447668a4654582]::collect::type_of::type_of
 119:     0x7f8022e60be9 - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>
 120:     0x7f8023059f29 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::DefaultCache<rustc_span[3d5dc97049ad8d50]::def_id::DefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, true>
 121:     0x7f80230241a9 - rustc_query_impl[664ae873a521fa7c]::query_impl::type_of::get_query_incr::__rust_end_short_backtrace
 122:     0x7f8022f0a83b - rustc_middle[aca4860da4e5a967]::query::plumbing::query_get_at::<rustc_query_system[b5dcdc06a735d5f1]::query::caches::DefaultCache<rustc_span[3d5dc97049ad8d50]::def_id::DefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>>
 123:     0x7f80239ec0b2 - rustc_hir_analysis[eb447668a4654582]::check::check::check_mod_item_types
 124:     0x7f80239eaa79 - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::check_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 0usize]>>
 125:     0x7f8023773529 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::DefaultCache<rustc_span[3d5dc97049ad8d50]::def_id::LocalModDefId, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, true>
 126:     0x7f8023282b00 - rustc_query_impl[664ae873a521fa7c]::query_impl::check_mod_item_types::get_query_incr::__rust_end_short_backtrace
 127:     0x7f802328379b - rustc_hir_analysis[eb447668a4654582]::check_crate
 128:     0x7f802348db59 - rustc_interface[fbb0cb4be6c0ba34]::passes::analysis
 129:     0x7f802348d575 - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 1usize]>>
 130:     0x7f8023924844 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::SingleCache<rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, true>
 131:     0x7f8023924520 - rustc_query_impl[664ae873a521fa7c]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
 132:     0x7f8023c07021 - rustc_interface[fbb0cb4be6c0ba34]::interface::run_compiler::<core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>, rustc_driver_impl[7d23c5715ff089db]::run_compiler::{closure#1}>::{closure#0}
 133:     0x7f8023c0215b - std[409886f6357001f0]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[fbb0cb4be6c0ba34]::util::run_in_thread_with_globals<rustc_interface[fbb0cb4be6c0ba34]::interface::run_compiler<core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>, rustc_driver_impl[7d23c5715ff089db]::run_compiler::{closure#1}>::{closure#0}, core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>>
 134:     0x7f8023c01fb3 - <<std[409886f6357001f0]::thread::Builder>::spawn_unchecked_<rustc_interface[fbb0cb4be6c0ba34]::util::run_in_thread_with_globals<rustc_interface[fbb0cb4be6c0ba34]::interface::run_compiler<core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>, rustc_driver_impl[7d23c5715ff089db]::run_compiler::{closure#1}>::{closure#0}, core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>>::{closure#1} as core[21cdcf8e8af4c2d9]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
 135:     0x7f801ef706a5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc7eafaff61e32df9
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/boxed.rs:2007:9
 136:     0x7f801ef706a5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6ba4a5de48dd2304
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/boxed.rs:2007:9
 137:     0x7f801ef706a5 - std::sys::unix::thread::Thread::new::thread_start::he469335aef763e45
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/thread.rs:108:17
 138:     0x7f801ed59383 - start_thread
 139:     0x7f801eddc00c - __clone3
 140:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.75.0 (82e1608df 2023-12-21) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [mir_built] building MIR for `grpc::server::<impl at linera-rpc/src/grpc/server.rs:175:1: 178:38>::forward_cross_chain_queries::{closure#0}::{closure#0}::{closure#0}::{closure#0}::{closure#0}::{closure#0}`
#1 [unsafety_check_result] unsafety-checking `grpc::server::<impl at linera-rpc/src/grpc/server.rs:175:1: 178:38>::forward_cross_chain_queries::{closure#0}::{closure#0}::{closure#0}::{closure#0}::{closure#0}::{closure#0}`
#2 [unsafety_check_result] unsafety-checking `grpc::server::<impl at linera-rpc/src/grpc/server.rs:175:1: 178:38>::forward_cross_chain_queries::{closure#0}::{closure#0}::{closure#0}::{closure#0}::{closure#0}`
#3 [unsafety_check_result] unsafety-checking `grpc::server::<impl at linera-rpc/src/grpc/server.rs:175:1: 178:38>::forward_cross_chain_queries::{closure#0}::{closure#0}::{closure#0}::{closure#0}`
#4 [unsafety_check_result] unsafety-checking `grpc::server::<impl at linera-rpc/src/grpc/server.rs:175:1: 178:38>::forward_cross_chain_queries::{closure#0}::{closure#0}::{closure#0}`
#5 [unsafety_check_result] unsafety-checking `grpc::server::<impl at linera-rpc/src/grpc/server.rs:175:1: 178:38>::forward_cross_chain_queries::{closure#0}::{closure#0}`
#6 [unsafety_check_result] unsafety-checking `grpc::server::<impl at linera-rpc/src/grpc/server.rs:175:1: 178:38>::forward_cross_chain_queries::{closure#0}`
#7 [unsafety_check_result] unsafety-checking `grpc::server::<impl at linera-rpc/src/grpc/server.rs:175:1: 178:38>::forward_cross_chain_queries`
#8 [mir_const] preparing `grpc::server::<impl at linera-rpc/src/grpc/server.rs:175:1: 178:38>::forward_cross_chain_queries` for borrow checking
#9 [mir_promoted] promoting constants in MIR for `grpc::server::<impl at linera-rpc/src/grpc/server.rs:175:1: 178:38>::forward_cross_chain_queries`
#10 [mir_borrowck] borrow-checking `grpc::server::<impl at linera-rpc/src/grpc/server.rs:175:1: 178:38>::forward_cross_chain_queries`
#11 [type_of_opaque] computing type of opaque `grpc::server::<impl at linera-rpc/src/grpc/server.rs:175:1: 178:38>::forward_cross_chain_queries::{opaque#0}`
#12 [typeck] type-checking `grpc::server::<impl at linera-rpc/src/grpc/server.rs:175:1: 178:38>::spawn`
#13 [type_of_opaque] computing type of opaque `grpc::server::<impl at linera-rpc/src/grpc/server.rs:175:1: 178:38>::spawn::{opaque#0}`
#14 [type_of] computing type of `grpc::server::<impl at linera-rpc/src/grpc/server.rs:175:1: 178:38>::spawn::{opaque#0}`
#15 [check_mod_item_types] checking item types in module `grpc::server`
#16 [analysis] running analysis passes on this crate
end of query stack
Backtrace

``` stack backtrace: 0: rust_begin_unwind at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:645:5 1: core::panicking::panic_fmt at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:72:14 2: core::panicking::panic at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:127:5 3: ::expr_into_dest 4: ::as_temp::{closure#0} 5: ::as_operand 6: ::as_call_operand 7: ::as_call_operand 8: ::expr_into_dest 9: ::as_temp::{closure#0} 10: ::as_operand 11: ::as_call_operand 12: ::as_call_operand 13: ::expr_into_dest 14: ::as_temp::{closure#0} 15: ::as_operand 16: ::as_call_operand 17: ::as_call_operand 18: ::expr_into_dest 19: ::as_temp::{closure#0} 20: ::expr_as_place 21: ::expr_as_place 22: ::expr_into_dest 23: ::expr_into_dest 24: ::ast_block_stmts 25: ::expr_into_dest 26: ::expr_into_dest 27: ::expr_into_dest 28: rustc_mir_build::build::mir_build::{closure#0} 29: rustc_mir_build::build::mir_built [... omitted 1 frame ...] 30: rustc_mir_transform::check_unsafety::unsafety_check_result [... omitted 1 frame ...] 31: rustc_mir_transform::check_unsafety::unsafety_check_result [... omitted 1 frame ...] 32: rustc_mir_transform::check_unsafety::unsafety_check_result [... omitted 1 frame ...] 33: rustc_mir_transform::check_unsafety::unsafety_check_result [... omitted 1 frame ...] 34: rustc_mir_transform::check_unsafety::unsafety_check_result [... omitted 1 frame ...] 35: rustc_mir_transform::check_unsafety::unsafety_check_result [... omitted 1 frame ...] 36: rustc_mir_transform::check_unsafety::unsafety_check_result [... omitted 1 frame ...] 37: rustc_mir_transform::mir_const [... omitted 1 frame ...] 38: rustc_mir_transform::mir_promoted [... omitted 1 frame ...] 39: rustc_borrowck::mir_borrowck [... omitted 1 frame ...] 40: rustc_hir_analysis::collect::type_of::type_of_opaque [... omitted 1 frame ...] 41: rustc_middle::query::plumbing::query_get_at::>> 42: ::poly_select 43: ::process_obligation 44: >::process_obligations:: 45: ::check_argument_types 46: ::check_call 47: ::check_expr_with_expectation_and_args 48: ::check_block_with_expected 49: ::check_expr_with_expectation_and_args 50: ::check_expr_with_expectation_and_args 51: ::check_block_with_expected 52: ::check_expr_with_expectation_and_args 53: rustc_hir_typeck::check::check_fn 54: ::check_expr_closure ```

clubby789 commented 8 months ago

Can you reproduce this on stable Rust, or nightly?

Twey commented 8 months ago

This is stable Rust 1.75.0:

$ rustc --version --verbose
rustc 1.75.0 (82e1608df 2023-12-21)
binary: rustc
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
commit-date: 2023-12-21
host: x86_64-unknown-linux-gnu
release: 1.75.0
LLVM version: 17.0.6

I can reproduce it from clean.

clubby789 commented 8 months ago

The current stable is 1.76.0

Twey commented 8 months ago

Oh, I can't keep up!

It doesn't reproduce on 1.76.0. Feel free to close if you like.

matthiaskrgr commented 8 months ago

Could be a duplicate of https://github.com/rust-lang/rust/issues/119786

jieyouxu commented 8 months ago

Closing as it seems to be fixed on stable 1.76.0.