Skip to content

ICE: "assertion failed: *old == value" in optimized + incremental builds #126741

Closed
@BobG1983

Description

@BobG1983

Repro:

Rustc Version: rustc 1.81.0-nightly (59e2c01 2024-06-17)
Toolchain: nightly-x86_64-pc-windows-msvc

What I did:
Clone https://www.github.com/BobG1983/rantz_random.git
run cargo test
run cargo test again.

Issue:

The compiler panics with the following output:

thread 'rustc' panicked at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db\compiler\rustc_data_structures\src\sync.rs:338:42:
assertion failed: *old == value
stack backtrace:
   0:     0x7ffe2a00d5d3 - std::backtrace_rs::backtrace::dbghelp64::trace
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\..\..\backtrace\src\backtrace\dbghelp64.rs:91
   1:     0x7ffe2a00d5d3 - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ffe2a00d5d3 - std::backtrace::Backtrace::create
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\backtrace.rs:331
   3:     0x7ffe2a00d51a - std::backtrace::Backtrace::force_capture
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\backtrace.rs:312
   4:     0x7ffde674e510 - memchr
   5:     0x7ffe2a027337 - alloc::boxed::impl$50::call
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\alloc\src\boxed.rs:2076
   6:     0x7ffe2a027337 - std::panicking::rust_panic_with_hook
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\panicking.rs:801
   7:     0x7ffe2a02710f - std::panicking::begin_panic_handler::closure$0
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\panicking.rs:660
   8:     0x7ffe2a0245af - std::sys::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\sys\backtrace.rs:171
   9:     0x7ffe2a026d66 - std::panicking::begin_panic_handler
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\panicking.rs:658
  10:     0x7ffe2a07cf64 - core::panicking::panic_fmt
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\core\src\panicking.rs:74
  11:     0x7ffe2a07d00d - core::panicking::panic
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\core\src\panicking.rs:148
  12:     0x7ffde51a4443 - <rustc_middle[3720665636316a56]::ty::context::TyCtxt>::set_alloc_id_same_memory
  13:     0x7ffde507a807 - <rustc_metadata[beec48ef7521b97d]::rmeta::decoder::DecodeContext as rustc_type_ir[69993b1d9e925772]::codec::TyDecoder>::decode_alloc_id
  14:     0x7ffde6247d9b - <aho_corasick[ac69cc43042af094]::util::prefilter::Builder>::build
  15:     0x7ffde6232446 - <aho_corasick[ac69cc43042af094]::util::prefilter::Builder>::build
  16:     0x7ffde62cdfc3 - <rustc_metadata[beec48ef7521b97d]::creader::alloc_error_handler_spans::Finder as rustc_ast[9ac2f267a929ff38]::visit::Visitor>::visit_item
  17:     0x7ffde5d3de6b - rustc_query_impl[f350898e45c5ba56]::plumbing::query_key_hash_verify_all
  18:     0x7ffde5c3453e - rustc_ty_utils[4ce48a55c0187f78]::ty::self_ty_of_trait_impl_enabling_order_dep_trait_object_hack
  19:     0x7ffde4e95ad5 - rustc_query_impl[f350898e45c5ba56]::query_system
  20:     0x7ffde661731f - <rustc_middle[3720665636316a56]::ty::context::TyCtxt>::instance_mir
  21:     0x7ffde61d8ab3 - rustc_monomorphize[cd4d3c758268f64]::is_call_from_compiler_builtins_to_upstream_monomorphization
  22:     0x7ffde61d5bc9 - rustc_monomorphize[cd4d3c758268f64]::is_call_from_compiler_builtins_to_upstream_monomorphization
  23:     0x7ffde61d7872 - rustc_monomorphize[cd4d3c758268f64]::is_call_from_compiler_builtins_to_upstream_monomorphization
  24:     0x7ffde76ebb5d - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  25:     0x7ffde76f0727 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  26:     0x7ffde76ebe18 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  27:     0x7ffde76f0727 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  28:     0x7ffde76ebe18 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  29:     0x7ffde76f0727 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  30:     0x7ffde76ebe18 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  31:     0x7ffde76f5a57 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  32:     0x7ffde7db1669 - <rayon_core[744fdfe6ee7fdbd]::registry::WorkerThread>::wait_until_cold
  33:     0x7ffde7dadc35 - <rayon_core[744fdfe6ee7fdbd]::registry::ThreadBuilder>::run
  34:     0x7ffde67514dc - memchr
  35:     0x7ffde6745efd - memchr
  36:     0x7ffde6750dd1 - memchr
  37:     0x7ffe2a03834d - alloc::boxed::impl$48::call_once
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\alloc\src\boxed.rs:2062
  38:     0x7ffe2a03834d - alloc::boxed::impl$48::call_once
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\alloc\src\boxed.rs:2062
  39:     0x7ffe2a03834d - std::sys::pal::windows::thread::impl$0::new::thread_start
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\sys\pal\windows\thread.rs:52
  40:     0x7ffeb94c257d - BaseThreadInitThunk
  41:     0x7ffeba70af28 - RtlUserThreadStart


rustc version: 1.81.0-nightly (59e2c01c2 2024-06-17)
platform: x86_64-pc-windows-msvc

query stack during panic:
#0 [optimized_mir] optimizing MIR for `fastrand::global_rng::u128`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
thread 'rustc' panicked at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db\compiler\rustc_data_structures\src\sync.rs:338:42:
assertion failed: *old == value
stack backtrace:
   0:     0x7ffe2a00d5d3 - std::backtrace_rs::backtrace::dbghelp64::trace
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\..\..\backtrace\src\backtrace\dbghelp64.rs:91
   1:     0x7ffe2a00d5d3 - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ffe2a00d5d3 - std::backtrace::Backtrace::create
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\backtrace.rs:331
   3:     0x7ffe2a00d51a - std::backtrace::Backtrace::force_capture
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\backtrace.rs:312
   4:     0x7ffde674e510 - memchr
   5:     0x7ffe2a027337 - alloc::boxed::impl$50::call
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\alloc\src\boxed.rs:2076
   6:     0x7ffe2a027337 - std::panicking::rust_panic_with_hook
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\panicking.rs:801
   7:     0x7ffe2a02710f - std::panicking::begin_panic_handler::closure$0
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\panicking.rs:660
   8:     0x7ffe2a0245af - std::sys::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\sys\backtrace.rs:171
   9:     0x7ffe2a026d66 - std::panicking::begin_panic_handler
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\panicking.rs:658
  10:     0x7ffe2a07cf64 - core::panicking::panic_fmt
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\core\src\panicking.rs:74
  11:     0x7ffe2a07d00d - core::panicking::panic
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\core\src\panicking.rs:148
  12:     0x7ffde51a4443 - <rustc_middle[3720665636316a56]::ty::context::TyCtxt>::set_alloc_id_same_memory
  13:     0x7ffde507a807 - <rustc_metadata[beec48ef7521b97d]::rmeta::decoder::DecodeContext as rustc_type_ir[69993b1d9e925772]::codec::TyDecoder>::decode_alloc_id
  14:     0x7ffde6247d9b - <aho_corasick[ac69cc43042af094]::util::prefilter::Builder>::build
  15:     0x7ffde6232446 - <aho_corasick[ac69cc43042af094]::util::prefilter::Builder>::build
  16:     0x7ffde62cdfc3 - <rustc_metadata[beec48ef7521b97d]::creader::alloc_error_handler_spans::Finder as rustc_ast[9ac2f267a929ff38]::visit::Visitor>::visit_item
  17:     0x7ffde5d3de6b - rustc_query_impl[f350898e45c5ba56]::plumbing::query_key_hash_verify_all
  18:     0x7ffde5c3453e - rustc_ty_utils[4ce48a55c0187f78]::ty::self_ty_of_trait_impl_enabling_order_dep_trait_object_hack
  19:     0x7ffde4e95ad5 - rustc_query_impl[f350898e45c5ba56]::query_system
  20:     0x7ffde661731f - <rustc_middle[3720665636316a56]::ty::context::TyCtxt>::instance_mir
  21:     0x7ffde61d8ab3 - rustc_monomorphize[cd4d3c758268f64]::is_call_from_compiler_builtins_to_upstream_monomorphization
  22:     0x7ffde61d5bc9 - rustc_monomorphize[cd4d3c758268f64]::is_call_from_compiler_builtins_to_upstream_monomorphization
  23:     0x7ffde61d7872 - rustc_monomorphize[cd4d3c758268f64]::is_call_from_compiler_builtins_to_upstream_monomorphization
  24:     0x7ffde76ebb5d - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  25:     0x7ffde76f0727 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  26:     0x7ffde76ebe18 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  27:     0x7ffde76f0727 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  28:     0x7ffde76ebe18 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  29:     0x7ffde76f5a57 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  30:     0x7ffde7db1669 - <rayon_core[744fdfe6ee7fdbd]::registry::WorkerThread>::wait_until_cold
  31:     0x7ffde7dadc35 - <rayon_core[744fdfe6ee7fdbd]::registry::ThreadBuilder>::run
  32:     0x7ffde67514dc - memchr
  33:     0x7ffde6745efd - memchr
  34:     0x7ffde6750dd1 - memchr
  35:     0x7ffe2a03834d - alloc::boxed::impl$48::call_once
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\alloc\src\boxed.rs:2062
  36:     0x7ffe2a03834d - alloc::boxed::impl$48::call_once
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\alloc\src\boxed.rs:2062
  37:     0x7ffe2a03834d - std::sys::pal::windows::thread::impl$0::new::thread_start
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\sys\pal\windows\thread.rs:52
  38:     0x7ffeb94c257d - BaseThreadInitThunk
  39:     0x7ffeba70af28 - RtlUserThreadStart


query stack during panic:
#0 [optimized_mir] optimizing MIR for `fastrand::global_rng::i64`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
thread 'rustc' panicked at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db\compiler\rustc_data_structures\src\sync.rs:338:42:
assertion failed: *old == value
stack backtrace:
   0:     0x7ffe2a00d5d3 - std::backtrace_rs::backtrace::dbghelp64::trace
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\..\..\backtrace\src\backtrace\dbghelp64.rs:91
   1:     0x7ffe2a00d5d3 - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ffe2a00d5d3 - std::backtrace::Backtrace::create
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\backtrace.rs:331
   3:     0x7ffe2a00d51a - std::backtrace::Backtrace::force_capture
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\backtrace.rs:312
   4:     0x7ffde674e510 - memchr
   5:     0x7ffe2a027337 - alloc::boxed::impl$50::call
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\alloc\src\boxed.rs:2076
   6:     0x7ffe2a027337 - std::panicking::rust_panic_with_hook
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\panicking.rs:801
   7:     0x7ffe2a02710f - std::panicking::begin_panic_handler::closure$0
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\panicking.rs:660
   8:     0x7ffe2a0245af - std::sys::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\sys\backtrace.rs:171
   9:     0x7ffe2a026d66 - std::panicking::begin_panic_handler
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\panicking.rs:658
  10:     0x7ffe2a07cf64 - core::panicking::panic_fmt
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\core\src\panicking.rs:74
  11:     0x7ffe2a07d00d - core::panicking::panic
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\core\src\panicking.rs:148
  12:     0x7ffde51a4443 - <rustc_middle[3720665636316a56]::ty::context::TyCtxt>::set_alloc_id_same_memory
  13:     0x7ffde507a807 - <rustc_metadata[beec48ef7521b97d]::rmeta::decoder::DecodeContext as rustc_type_ir[69993b1d9e925772]::codec::TyDecoder>::decode_alloc_id
  14:     0x7ffde6247d9b - <aho_corasick[ac69cc43042af094]::util::prefilter::Builder>::build
  15:     0x7ffde6232446 - <aho_corasick[ac69cc43042af094]::util::prefilter::Builder>::build
  16:     0x7ffde62cdfc3 - <rustc_metadata[beec48ef7521b97d]::creader::alloc_error_handler_spans::Finder as rustc_ast[9ac2f267a929ff38]::visit::Visitor>::visit_item
  17:     0x7ffde5d3de6b - rustc_query_impl[f350898e45c5ba56]::plumbing::query_key_hash_verify_all
  18:     0x7ffde5c3453e - rustc_ty_utils[4ce48a55c0187f78]::ty::self_ty_of_trait_impl_enabling_order_dep_trait_object_hack
  19:     0x7ffde4e95ad5 - rustc_query_impl[f350898e45c5ba56]::query_system
  20:     0x7ffde661731f - <rustc_middle[3720665636316a56]::ty::context::TyCtxt>::instance_mir
  21:     0x7ffde61d8ab3 - rustc_monomorphize[cd4d3c758268f64]::is_call_from_compiler_builtins_to_upstream_monomorphization
  22:     0x7ffde61d5bc9 - rustc_monomorphize[cd4d3c758268f64]::is_call_from_compiler_builtins_to_upstream_monomorphization
  23:     0x7ffde61d7872 - rustc_monomorphize[cd4d3c758268f64]::is_call_from_compiler_builtins_to_upstream_monomorphization
  24:     0x7ffde76ebb5d - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  25:     0x7ffde76f0814 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  26:     0x7ffde76ebe18 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  27:     0x7ffde76f0727 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  28:     0x7ffde76ebe18 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  29:     0x7ffde76f5a57 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  30:     0x7ffde7db1669 - <rayon_core[744fdfe6ee7fdbd]::registry::WorkerThread>::wait_until_cold
  31:     0x7ffde7dadc35 - <rayon_core[744fdfe6ee7fdbd]::registry::ThreadBuilder>::run
  32:     0x7ffde67514dc - memchr
  33:     0x7ffde6745efd - memchr
  34:     0x7ffde6750dd1 - memchr
  35:     0x7ffe2a03834d - alloc::boxed::impl$48::call_once
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\alloc\src\boxed.rs:2062
  36:     0x7ffe2a03834d - alloc::boxed::impl$48::call_once
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\alloc\src\boxed.rs:2062
  37:     0x7ffe2a03834d - std::sys::pal::windows::thread::impl$0::new::thread_start
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\sys\pal\windows\thread.rs:52
  38:     0x7ffeb94c257d - BaseThreadInitThunk
  39:     0x7ffeba70af28 - RtlUserThreadStart


query stack during panic:
#0 [optimized_mir] optimizing MIR for `fastrand::global_rng::i8`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
thread 'rustc' panicked at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db\compiler\rustc_data_structures\src\sync.rs:338:42:
assertion failed: *old == value
stack backtrace:
   0:     0x7ffe2a00d5d3 - std::backtrace_rs::backtrace::dbghelp64::trace
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\..\..\backtrace\src\backtrace\dbghelp64.rs:91
   1:     0x7ffe2a00d5d3 - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ffe2a00d5d3 - std::backtrace::Backtrace::create
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\backtrace.rs:331
   3:     0x7ffe2a00d51a - std::backtrace::Backtrace::force_capture
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\backtrace.rs:312
   4:     0x7ffde674e510 - memchr
   5:     0x7ffe2a027337 - alloc::boxed::impl$50::call
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\alloc\src\boxed.rs:2076
   6:     0x7ffe2a027337 - std::panicking::rust_panic_with_hook
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\panicking.rs:801
   7:     0x7ffe2a02710f - std::panicking::begin_panic_handler::closure$0
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\panicking.rs:660
   8:     0x7ffe2a0245af - std::sys::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\sys\backtrace.rs:171
   9:     0x7ffe2a026d66 - std::panicking::begin_panic_handler
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\panicking.rs:658
  10:     0x7ffe2a07cf64 - core::panicking::panic_fmt
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\core\src\panicking.rs:74
  11:     0x7ffe2a07d00d - core::panicking::panic
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\core\src\panicking.rs:148
  12:     0x7ffde51a4443 - <rustc_middle[3720665636316a56]::ty::context::TyCtxt>::set_alloc_id_same_memory
  13:     0x7ffde507a807 - <rustc_metadata[beec48ef7521b97d]::rmeta::decoder::DecodeContext as rustc_type_ir[69993b1d9e925772]::codec::TyDecoder>::decode_alloc_id
  14:     0x7ffde6247d9b - <aho_corasick[ac69cc43042af094]::util::prefilter::Builder>::build
  15:     0x7ffde6232446 - <aho_corasick[ac69cc43042af094]::util::prefilter::Builder>::build
  16:     0x7ffde62cdfc3 - <rustc_metadata[beec48ef7521b97d]::creader::alloc_error_handler_spans::Finder as rustc_ast[9ac2f267a929ff38]::visit::Visitor>::visit_item
  17:     0x7ffde5d3de6b - rustc_query_impl[f350898e45c5ba56]::plumbing::query_key_hash_verify_all
  18:     0x7ffde5c3453e - rustc_ty_utils[4ce48a55c0187f78]::ty::self_ty_of_trait_impl_enabling_order_dep_trait_object_hack
  19:     0x7ffde4e95ad5 - rustc_query_impl[f350898e45c5ba56]::query_system
  20:     0x7ffde661731f - <rustc_middle[3720665636316a56]::ty::context::TyCtxt>::instance_mir
  21:     0x7ffde61d8ab3 - rustc_monomorphize[cd4d3c758268f64]::is_call_from_compiler_builtins_to_upstream_monomorphization
  22:     0x7ffde61d5bc9 - rustc_monomorphize[cd4d3c758268f64]::is_call_from_compiler_builtins_to_upstream_monomorphization
  23:     0x7ffde61d7872 - rustc_monomorphize[cd4d3c758268f64]::is_call_from_compiler_builtins_to_upstream_monomorphization
  24:     0x7ffde76ebb5d - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  25:     0x7ffde76f0727 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  26:     0x7ffde76ebe18 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  27:     0x7ffde76f5a57 - <gimli[87f9d3ffa14e46ff]::write::str::LineStringTable>::get
  28:     0x7ffde7db1669 - <rayon_core[744fdfe6ee7fdbd]::registry::WorkerThread>::wait_until_cold
  29:     0x7ffde7dadc35 - <rayon_core[744fdfe6ee7fdbd]::registry::ThreadBuilder>::run
  30:     0x7ffde67514dc - memchr
  31:     0x7ffde6745efd - memchr
  32:     0x7ffde6750dd1 - memchr
  33:     0x7ffe2a03834d - alloc::boxed::impl$48::call_once
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\alloc\src\boxed.rs:2062
  34:     0x7ffe2a03834d - alloc::boxed::impl$48::call_once
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\alloc\src\boxed.rs:2062
  35:     0x7ffe2a03834d - std::sys::pal::windows::thread::impl$0::new::thread_start
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library\std\src\sys\pal\windows\thread.rs:52
  36:     0x7ffeb94c257d - BaseThreadInitThunk
  37:     0x7ffeba70af28 - RtlUserThreadStart


query stack during panic:
#0 [optimized_mir] optimizing MIR for `fastrand::global_rng::i16`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack

Activity

added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Jun 20, 2024
Nemo157

Nemo157 commented on Jun 27, 2024

@Nemo157
Member

I just got a very similar ICE while compiling a proprietary codebase

thread 'rustc' panicked at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/compiler/rustc_data_structures/src/sync.rs:338:42:
assertion failed: *old == value
stack backtrace:
   0:     0x7f6fe6d44975 - std::backtrace_rs::backtrace::libunwind::trace::h184e33fa7a4efbe9
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x7f6fe6d44975 - std::backtrace_rs::backtrace::trace_unsynchronized::hc3eac562c05961d9
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f6fe6d44975 - std::backtrace::Backtrace::create::h85924e152703a8fb
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/backtrace.rs:331:13
   3:     0x7f6fe6d448c5 - std::backtrace::Backtrace::force_capture::h3dc650b8da4f2095
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/backtrace.rs:312:9
   4:     0x7f6fea0c7206 - std[c3fbaf9a0386b13c]::panicking::update_hook::<alloc[3df32a5d58f536a7]::boxed::Box<rustc_driver_impl[ee4d79150a07c4f8]::install_ice_hook::{closure#0}>>::{closure#0}
   5:     0x7f6fe6d5fa4f - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::ha3b0d962ec1ff02b
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/alloc/src/boxed.rs:2076:9
   6:     0x7f6fe6d5fa4f - std::panicking::rust_panic_with_hook::h0adf1873cdd8ce86
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/panicking.rs:801:13
   7:     0x7f6fe6d5f643 - std::panicking::begin_panic_handler::{{closure}}::h14e7b85ca1885ac4
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/panicking.rs:660:13
   8:     0x7f6fe6d5cdf9 - std::sys::backtrace::__rust_end_short_backtrace::h17e9af05fae71c34
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/sys/backtrace.rs:171:18
   9:     0x7f6fe6d5f324 - rust_begin_unwind
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/panicking.rs:658:5
  10:     0x7f6fe6da9a73 - core::panicking::panic_fmt::h273dffa90a45a379
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/core/src/panicking.rs:74:14
  11:     0x7f6fe6da9afc - core::panicking::panic::hf430b0f328d1e0c3
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/core/src/panicking.rs:148:5
  12:     0x7f6febda652a - <rustc_middle[516cb2fde7e58e9c]::ty::context::TyCtxt>::set_alloc_id_same_memory
  13:     0x7f6febda817a - <rustc_metadata[7225a1edc81ce069]::rmeta::decoder::DecodeContext as rustc_type_ir[c8111a7f01cd6547]::codec::TyDecoder>::decode_alloc_id
  14:     0x7f6fec689761 - <rustc_middle[516cb2fde7e58e9c]::mir::syntax::Operand as rustc_serialize[cdae1fdc1aabbafe]::serialize::Decodable<rustc_metadata[7225a1edc81ce069]::rmeta::decoder::DecodeContext>>::decode.warm
  15:     0x7f6feb6de740 - <rustc_middle[516cb2fde7e58e9c]::mir::Body as rustc_serialize[cdae1fdc1aabbafe]::serialize::Decodable<rustc_metadata[7225a1edc81ce069]::rmeta::decoder::DecodeContext>>::decode
  16:     0x7f6febb995cc - rustc_metadata[7225a1edc81ce069]::rmeta::decoder::cstore_impl::provide_extern::optimized_mir
  17:     0x7f6febb992f5 - rustc_query_impl[250cb7a150488de5]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[250cb7a150488de5]::query_impl::optimized_mir::dynamic_query::{closure#2}::{closure#0}, rustc_middle[516cb2fde7e58e9c]::query::erase::Erased<[u8; 8usize]>>
  18:     0x7f6feb7bb290 - rustc_query_system[7ef52ba0f7b4d7c0]::query::plumbing::try_execute_query::<rustc_query_impl[250cb7a150488de5]::DynamicConfig<rustc_query_system[7ef52ba0f7b4d7c0]::query::caches::DefIdCache<rustc_middle[516cb2fde7e58e9c]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[250cb7a150488de5]::plumbing::QueryCtxt, true>
  19:     0x7f6feb7b872b - rustc_query_impl[250cb7a150488de5]::query_impl::optimized_mir::get_query_incr::__rust_end_short_backtrace
  20:     0x7f6febbac55d - <rustc_middle[516cb2fde7e58e9c]::ty::context::TyCtxt>::instance_mir
  21:     0x7f6fec26dc28 - rustc_monomorphize[d5fadf6a90eab74c]::collector::collect_items_rec::{closure#0}
  22:     0x7f6feb48a707 - rustc_monomorphize[d5fadf6a90eab74c]::collector::collect_items_rec
  23:     0x7f6feb48ae91 - rustc_monomorphize[d5fadf6a90eab74c]::collector::collect_items_rec
  24:     0x7f6feb48ae91 - rustc_monomorphize[d5fadf6a90eab74c]::collector::collect_items_rec
  25:     0x7f6feb48ae91 - rustc_monomorphize[d5fadf6a90eab74c]::collector::collect_items_rec
  26:     0x7f6fea7b5704 - rayon[92163da674b3e24f]::iter::plumbing::bridge_producer_consumer::helper::<rayon[92163da674b3e24f]::vec::DrainProducer<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem>, rayon[92163da674b3e24f]::iter::for_each::ForEachConsumer<rustc_data_structures[25e7fbd825e2c556]::sync::parallel::enabled::par_for_each_in<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem, alloc[3df32a5d58f536a7]::vec::Vec<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem>, rustc_monomorphize[d5fadf6a90eab74c]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>
  27:     0x7f6fea7bcf2d - <rayon_core[36277e153e91b8ec]::job::StackJob<rayon_core[36277e153e91b8ec]::latch::SpinLatch, rayon_core[36277e153e91b8ec]::join::join_context::call_b<(), rayon[92163da674b3e24f]::iter::plumbing::bridge_producer_consumer::helper<rayon[92163da674b3e24f]::vec::DrainProducer<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem>, rayon[92163da674b3e24f]::iter::for_each::ForEachConsumer<rustc_data_structures[25e7fbd825e2c556]::sync::parallel::enabled::par_for_each_in<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem, alloc[3df32a5d58f536a7]::vec::Vec<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem>, rustc_monomorphize[d5fadf6a90eab74c]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#1}>::{closure#0}, ()> as rayon_core[36277e153e91b8ec]::job::Job>::execute
  28:     0x7f6fe9c8e3c9 - <rayon_core[36277e153e91b8ec]::registry::WorkerThread>::wait_until_cold
  29:     0x7f6fea7b9388 - rayon_core[36277e153e91b8ec]::join::join_context::<rayon[92163da674b3e24f]::iter::plumbing::bridge_producer_consumer::helper<rayon[92163da674b3e24f]::vec::DrainProducer<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem>, rayon[92163da674b3e24f]::iter::for_each::ForEachConsumer<rustc_data_structures[25e7fbd825e2c556]::sync::parallel::enabled::par_for_each_in<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem, alloc[3df32a5d58f536a7]::vec::Vec<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem>, rustc_monomorphize[d5fadf6a90eab74c]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#0}, rayon[92163da674b3e24f]::iter::plumbing::bridge_producer_consumer::helper<rayon[92163da674b3e24f]::vec::DrainProducer<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem>, rayon[92163da674b3e24f]::iter::for_each::ForEachConsumer<rustc_data_structures[25e7fbd825e2c556]::sync::parallel::enabled::par_for_each_in<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem, alloc[3df32a5d58f536a7]::vec::Vec<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem>, rustc_monomorphize[d5fadf6a90eab74c]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#1}, (), ()>::{closure#0}
  30:     0x7f6fea7b58d1 - rayon[92163da674b3e24f]::iter::plumbing::bridge_producer_consumer::helper::<rayon[92163da674b3e24f]::vec::DrainProducer<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem>, rayon[92163da674b3e24f]::iter::for_each::ForEachConsumer<rustc_data_structures[25e7fbd825e2c556]::sync::parallel::enabled::par_for_each_in<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem, alloc[3df32a5d58f536a7]::vec::Vec<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem>, rustc_monomorphize[d5fadf6a90eab74c]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>
  31:     0x7f6fea7b9417 - rayon_core[36277e153e91b8ec]::join::join_context::<rayon[92163da674b3e24f]::iter::plumbing::bridge_producer_consumer::helper<rayon[92163da674b3e24f]::vec::DrainProducer<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem>, rayon[92163da674b3e24f]::iter::for_each::ForEachConsumer<rustc_data_structures[25e7fbd825e2c556]::sync::parallel::enabled::par_for_each_in<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem, alloc[3df32a5d58f536a7]::vec::Vec<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem>, rustc_monomorphize[d5fadf6a90eab74c]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#0}, rayon[92163da674b3e24f]::iter::plumbing::bridge_producer_consumer::helper<rayon[92163da674b3e24f]::vec::DrainProducer<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem>, rayon[92163da674b3e24f]::iter::for_each::ForEachConsumer<rustc_data_structures[25e7fbd825e2c556]::sync::parallel::enabled::par_for_each_in<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem, alloc[3df32a5d58f536a7]::vec::Vec<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem>, rustc_monomorphize[d5fadf6a90eab74c]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#1}, (), ()>::{closure#0}
  32:     0x7f6fea7b58d1 - rayon[92163da674b3e24f]::iter::plumbing::bridge_producer_consumer::helper::<rayon[92163da674b3e24f]::vec::DrainProducer<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem>, rayon[92163da674b3e24f]::iter::for_each::ForEachConsumer<rustc_data_structures[25e7fbd825e2c556]::sync::parallel::enabled::par_for_each_in<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem, alloc[3df32a5d58f536a7]::vec::Vec<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem>, rustc_monomorphize[d5fadf6a90eab74c]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>
  33:     0x7f6fea7bcf2d - <rayon_core[36277e153e91b8ec]::job::StackJob<rayon_core[36277e153e91b8ec]::latch::SpinLatch, rayon_core[36277e153e91b8ec]::join::join_context::call_b<(), rayon[92163da674b3e24f]::iter::plumbing::bridge_producer_consumer::helper<rayon[92163da674b3e24f]::vec::DrainProducer<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem>, rayon[92163da674b3e24f]::iter::for_each::ForEachConsumer<rustc_data_structures[25e7fbd825e2c556]::sync::parallel::enabled::par_for_each_in<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem, alloc[3df32a5d58f536a7]::vec::Vec<rustc_middle[516cb2fde7e58e9c]::mir::mono::MonoItem>, rustc_monomorphize[d5fadf6a90eab74c]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}>>::{closure#1}>::{closure#0}, ()> as rayon_core[36277e153e91b8ec]::job::Job>::execute
  34:     0x7f6fe9c8e3c9 - <rayon_core[36277e153e91b8ec]::registry::WorkerThread>::wait_until_cold
  35:     0x7f6fe9c8b2e9 - <rayon_core[36277e153e91b8ec]::registry::ThreadBuilder>::run
  36:     0x7f6fea0c9057 - <<crossbeam_utils[1c122dd7a40468ca]::thread::ScopedThreadBuilder>::spawn<<rayon_core[36277e153e91b8ec]::ThreadPoolBuilder>::build_scoped<rustc_interface[ad92266d8770ef5]::util::run_in_thread_pool_with_globals<rustc_interface[ad92266d8770ef5]::interface::run_compiler<core[2498b3506ce20dac]::result::Result<(), rustc_span[72d27a3883823780]::ErrorGuaranteed>, rustc_driver_impl[ee4d79150a07c4f8]::run_compiler::{closure#0}>::{closure#1}, core[2498b3506ce20dac]::result::Result<(), rustc_span[72d27a3883823780]::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}, rustc_interface[ad92266d8770ef5]::util::run_in_thread_pool_with_globals<rustc_interface[ad92266d8770ef5]::interface::run_compiler<core[2498b3506ce20dac]::result::Result<(), rustc_span[72d27a3883823780]::ErrorGuaranteed>, rustc_driver_impl[ee4d79150a07c4f8]::run_compiler::{closure#0}>::{closure#1}, core[2498b3506ce20dac]::result::Result<(), rustc_span[72d27a3883823780]::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#1}, core[2498b3506ce20dac]::result::Result<(), rustc_span[72d27a3883823780]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, ()>::{closure#0} as core[2498b3506ce20dac]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  37:     0x7f6fea0c171e - std[c3fbaf9a0386b13c]::sys::backtrace::__rust_begin_short_backtrace::<alloc[3df32a5d58f536a7]::boxed::Box<dyn core[2498b3506ce20dac]::ops::function::FnOnce<(), Output = ()> + core[2498b3506ce20dac]::marker::Send>, ()>
  38:     0x7f6fea0c8d05 - <<std[c3fbaf9a0386b13c]::thread::Builder>::spawn_unchecked_<alloc[3df32a5d58f536a7]::boxed::Box<dyn core[2498b3506ce20dac]::ops::function::FnOnce<(), Output = ()> + core[2498b3506ce20dac]::marker::Send>, ()>::{closure#2} as core[2498b3506ce20dac]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  39:     0x7f6fe6d698cb - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h415b3c48feec9148
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/alloc/src/boxed.rs:2062:9
  40:     0x7f6fe6d698cb - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h0d4446e047e96116
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/alloc/src/boxed.rs:2062:9
  41:     0x7f6fe6d698cb - std::sys::pal::unix::thread::Thread::new::thread_start::h01071f1a69504322
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/sys/pal/unix/thread.rs:108:17
  42:     0x7f6fe6b47272 - start_thread
  43:     0x7f6fe6bc2dec - __GI___clone3
  44:                0x0 - <unknown>


rustc version: 1.81.0-nightly (59e2c01c2 2024-06-17)
platform: x86_64-unknown-linux-gnu

query stack during panic:
#0 [optimized_mir] optimizing MIR for `<std::hash::random::RandomState as core::default::Default>::default`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
#2 [exported_symbols] collecting exported symbols for crate `0`
end of query stack

Running the build again did not hit the same error.

alecmocatta

alecmocatta commented on Jun 29, 2024

@alecmocatta
Contributor

Ditto, similar ICE compiling a proprietary codebase. This was on CI. Rerunning on the same commit then succeeded.

self.entry(key).and_modify(|old| assert!(*old == value)).or_insert(value);

self.alloc_map.lock().alloc_map.insert_same(id, GlobalAlloc::Memory(mem));

decoder.interner().set_alloc_id_same_memory(alloc_id, alloc);

Details
thread 'rustc' panicked at /rustc/9c3bc805dd9cb84019c124b9a50fdff1e62a7ec9/compiler/rustc_data_structures/src/sync.rs:338:42:
assertion failed: *old == value
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9c3bc805dd9cb84019c124b9a50fdff1e62a7ec9/library/std/src/panicking.rs:661:5
   1: core::panicking::panic_fmt
             at /rustc/9c3bc805dd9cb84019c124b9a50fdff1e62a7ec9/library/core/src/panicking.rs:74:14
   2: core::panicking::panic
             at /rustc/9c3bc805dd9cb84019c124b9a50fdff1e62a7ec9/library/core/src/panicking.rs:148:5
   3: <rustc_middle::ty::context::TyCtxt>::set_alloc_id_same_memory
   4: <rustc_metadata::rmeta::decoder::DecodeContext as rustc_type_ir::codec::TyDecoder>::decode_alloc_id
   5: <rustc_middle::mir::syntax::Operand as rustc_serialize::serialize::Decodable<rustc_metadata::rmeta::decoder::DecodeContext>>::decode.warm
   6: <rustc_middle::mir::Body as rustc_serialize::serialize::Decodable<rustc_metadata::rmeta::decoder::DecodeContext>>::decode
   7: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::optimized_mir
      [... omitted 1 frame ...]
   8: <rustc_middle::ty::context::TyCtxt>::instance_mir
   9: <rustc_mir_transform::inline::Inliner>::try_inlining
  10: <rustc_mir_transform::inline::Inliner>::process_blocks
  11: <rustc_mir_transform::inline::Inline as rustc_middle::mir::MirPass>::run_pass
  12: rustc_mir_transform::pass_manager::run_passes_inner
  13: rustc_mir_transform::optimized_mir
      [... omitted 1 frame ...]
  14: rustc_metadata::rmeta::encoder::prefetch_mir::{closure#0}
  15: rayon::iter::plumbing::bridge_producer_consumer::helper::<rayon::slice::IterProducer<indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>, rayon::iter::map::MapConsumer<rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &indexmap::set::IndexSet<rustc_span::def_id::LocalDefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, rustc_metadata::rmeta::encoder::prefetch_mir::{closure#0}>::{closure#0}::{closure#0}>, <indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>::key_ref>>
  16: rayon_core::join::join_context::<rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::slice::IterProducer<indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>, rayon::iter::map::MapConsumer<rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &indexmap::set::IndexSet<rustc_span::def_id::LocalDefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, rustc_metadata::rmeta::encoder::prefetch_mir::{closure#0}>::{closure#0}::{closure#0}>, <indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>::key_ref>>::{closure#0}, rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::slice::IterProducer<indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>, rayon::iter::map::MapConsumer<rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &indexmap::set::IndexSet<rustc_span::def_id::LocalDefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, rustc_metadata::rmeta::encoder::prefetch_mir::{closure#0}>::{closure#0}::{closure#0}>, <indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>::key_ref>>::{closure#1}, (), ()>::{closure#0}
  17: rayon::iter::plumbing::bridge_producer_consumer::helper::<rayon::slice::IterProducer<indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>, rayon::iter::map::MapConsumer<rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &indexmap::set::IndexSet<rustc_span::def_id::LocalDefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, rustc_metadata::rmeta::encoder::prefetch_mir::{closure#0}>::{closure#0}::{closure#0}>, <indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>::key_ref>>
  18: rayon_core::join::join_context::<rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::slice::IterProducer<indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>, rayon::iter::map::MapConsumer<rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &indexmap::set::IndexSet<rustc_span::def_id::LocalDefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, rustc_metadata::rmeta::encoder::prefetch_mir::{closure#0}>::{closure#0}::{closure#0}>, <indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>::key_ref>>::{closure#0}, rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::slice::IterProducer<indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>, rayon::iter::map::MapConsumer<rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &indexmap::set::IndexSet<rustc_span::def_id::LocalDefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, rustc_metadata::rmeta::encoder::prefetch_mir::{closure#0}>::{closure#0}::{closure#0}>, <indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>::key_ref>>::{closure#1}, (), ()>::{closure#0}
  19: rayon::iter::plumbing::bridge_producer_consumer::helper::<rayon::slice::IterProducer<indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>, rayon::iter::map::MapConsumer<rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &indexmap::set::IndexSet<rustc_span::def_id::LocalDefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, rustc_metadata::rmeta::encoder::prefetch_mir::{closure#0}>::{closure#0}::{closure#0}>, <indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>::key_ref>>
  20: rayon_core::join::join_context::<rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::slice::IterProducer<indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>, rayon::iter::map::MapConsumer<rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &indexmap::set::IndexSet<rustc_span::def_id::LocalDefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, rustc_metadata::rmeta::encoder::prefetch_mir::{closure#0}>::{closure#0}::{closure#0}>, <indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>::key_ref>>::{closure#0}, rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::slice::IterProducer<indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>, rayon::iter::map::MapConsumer<rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &indexmap::set::IndexSet<rustc_span::def_id::LocalDefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, rustc_metadata::rmeta::encoder::prefetch_mir::{closure#0}>::{closure#0}::{closure#0}>, <indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>::key_ref>>::{closure#1}, (), ()>::{closure#0}
  21: rayon::iter::plumbing::bridge_producer_consumer::helper::<rayon::slice::IterProducer<indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>, rayon::iter::map::MapConsumer<rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &indexmap::set::IndexSet<rustc_span::def_id::LocalDefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, rustc_metadata::rmeta::encoder::prefetch_mir::{closure#0}>::{closure#0}::{closure#0}>, <indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>::key_ref>>
  22: rayon_core::join::join_context::<rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::slice::IterProducer<indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>, rayon::iter::map::MapConsumer<rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &indexmap::set::IndexSet<rustc_span::def_id::LocalDefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, rustc_metadata::rmeta::encoder::prefetch_mir::{closure#0}>::{closure#0}::{closure#0}>, <indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>::key_ref>>::{closure#0}, rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::slice::IterProducer<indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>, rayon::iter::map::MapConsumer<rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &indexmap::set::IndexSet<rustc_span::def_id::LocalDefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, rustc_metadata::rmeta::encoder::prefetch_mir::{closure#0}>::{closure#0}::{closure#0}>, <indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>::key_ref>>::{closure#1}, (), ()>::{closure#0}
  23: rayon::iter::plumbing::bridge_producer_consumer::helper::<rayon::slice::IterProducer<indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>, rayon::iter::map::MapConsumer<rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &indexmap::set::IndexSet<rustc_span::def_id::LocalDefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, rustc_metadata::rmeta::encoder::prefetch_mir::{closure#0}>::{closure#0}::{closure#0}>, <indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>::key_ref>>
  24: rayon_core::join::join_context::<rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::slice::IterProducer<indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>, rayon::iter::map::MapConsumer<rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &indexmap::set::IndexSet<rustc_span::def_id::LocalDefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, rustc_metadata::rmeta::encoder::prefetch_mir::{closure#0}>::{closure#0}::{closure#0}>, <indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>::key_ref>>::{closure#0}, rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::slice::IterProducer<indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>, rayon::iter::map::MapConsumer<rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &indexmap::set::IndexSet<rustc_span::def_id::LocalDefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, rustc_metadata::rmeta::encoder::prefetch_mir::{closure#0}>::{closure#0}::{closure#0}>, <indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>::key_ref>>::{closure#1}, (), ()>::{closure#0}
  25: rayon::iter::plumbing::bridge_producer_consumer::helper::<rayon::slice::IterProducer<indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>, rayon::iter::map::MapConsumer<rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &indexmap::set::IndexSet<rustc_span::def_id::LocalDefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, rustc_metadata::rmeta::encoder::prefetch_mir::{closure#0}>::{closure#0}::{closure#0}>, <indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>::key_ref>>
  26: <rayon_core::job::StackJob<rayon_core::latch::SpinLatch, rayon_core::join::join_context::call_b<(), rayon::iter::plumbing::bridge_producer_consumer::helper<rayon::slice::IterProducer<indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>, rayon::iter::map::MapConsumer<rayon::iter::for_each::ForEachConsumer<rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &indexmap::set::IndexSet<rustc_span::def_id::LocalDefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, rustc_metadata::rmeta::encoder::prefetch_mir::{closure#0}>::{closure#0}::{closure#0}>, <indexmap::Bucket<rustc_span::def_id::LocalDefId, ()>>::key_ref>>::{closure#1}>::{closure#0}, ()> as rayon_core::job::Job>::execute
  27: <rayon_core::registry::WorkerThread>::wait_until_cold
  28: <rayon_core::registry::ThreadBuilder>::run
  29: <<crossbeam_utils::thread::ScopedThreadBuilder>::spawn<<rayon_core::ThreadPoolBuilder>::build_scoped<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}, rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, ()>::{closure#0} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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: please make sure that you have updated to the latest nightly

note: please attach the file at `/home/runner/_work/tably/tably/crates/autobahn/rustc-ice-2024-06-29T17_03_15-61567.txt` to your bug report

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C debug-assertions=on -C overflow-checks=off -C strip=debuginfo -Z oom=panic -Z proc-macro-backtrace -Z macro-backtrace -Z threads=8

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

query stack during panic:
#0 [optimized_mir] optimizing MIR for `std::collections::hash::map::HashMap::<K, V>::with_capacity`
#1 [optimized_mir] optimizing MIR for `<impl at /home/runner/_work/tably/tably/crates/autobahn/src/lib.rs:43:1: 43:24>::with_capacity`
end of query stack
added
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
on Jul 4, 2024
ChrisDenton

ChrisDenton commented on Jul 5, 2024

@ChrisDenton
Member

I got an ICE from the OP's code when building tests twice on x86_64-pc-windows-msvc with rustc 1.81.0-nightly (cc8da78 2024-07-04):

ICE
thread 'rustc' panicked at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e\compiler\rustc_data_structures\src\sync.rs:337:42:
assertion failed: *old == value
stack backtrace:
   0:     0x7ff81a02d5a3 - std::backtrace_rs::backtrace::dbghelp64::trace
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\..\..\backtrace\src\backtrace\dbghelp64.rs:91
   1:     0x7ff81a02d5a3 - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ff81a02d5a3 - std::backtrace::Backtrace::create
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\backtrace.rs:331
   3:     0x7ff81a02d4ea - std::backtrace::Backtrace::force_capture
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\backtrace.rs:312
   4:     0x7fffaadf6545 - memchr
   5:     0x7ff81a04846b - alloc::boxed::impl$50::call
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\alloc\src\boxed.rs:2078
   6:     0x7ff81a04846b - std::panicking::rust_panic_with_hook
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\panicking.rs:804
   7:     0x7ff81a04823f - std::panicking::begin_panic_handler::closure$0
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\panicking.rs:663
   8:     0x7ff81a04567f - std::sys::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\sys\backtrace.rs:171
   9:     0x7ff81a047e56 - std::panicking::begin_panic_handler
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\panicking.rs:661
  10:     0x7ff81a09dd94 - core::panicking::panic_fmt
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\core\src\panicking.rs:74
  11:     0x7ff81a09de3d - core::panicking::panic
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\core\src\panicking.rs:148
  12:     0x7fffa97e46a2 - <rustc_middle[bdeecb11c8336086]::ty::context::TyCtxt>::set_alloc_id_same_memory
  13:     0x7fffa96c89bb - <rustc_metadata[ad750163167944e7]::rmeta::decoder::DecodeContext as rustc_type_ir[9dfd536501306e43]::codec::TyDecoder>::decode_alloc_id
  14:     0x7fffaa8c87a4 - <aho_corasick[a2225782c592e1d2]::util::prefilter::Builder>::build
  15:     0x7fffaa8b4e2e - <aho_corasick[a2225782c592e1d2]::util::prefilter::Builder>::build
  16:     0x7fffaa952003 - <rustc_metadata[ad750163167944e7]::creader::alloc_error_handler_spans::Finder as rustc_ast[652270f71cc1a825]::visit::Visitor>::visit_item
  17:     0x7fffaa3bda13 - rustc_query_impl[ebda40cb8fea939a]::plumbing::query_key_hash_verify_all
  18:     0x7fffaa2ab0ee - rustc_ty_utils[ea289ddf2ac2917d]::ty::self_ty_of_trait_impl_enabling_order_dep_trait_object_hack
  19:     0x7fffa94e7c35 - rustc_query_impl[ebda40cb8fea939a]::query_system
  20:     0x7fffaacd1ff7 - <rustc_middle[bdeecb11c8336086]::ty::context::TyCtxt>::instance_mir
  21:     0x7fffaa857543 - rustc_monomorphize[662a250e8978a8be]::is_call_from_compiler_builtins_to_upstream_monomorphization
  22:     0x7fffaa854e06 - rustc_monomorphize[662a250e8978a8be]::is_call_from_compiler_builtins_to_upstream_monomorphization
  23:     0x7fffaa8564de - rustc_monomorphize[662a250e8978a8be]::is_call_from_compiler_builtins_to_upstream_monomorphization
  24:     0x7fffabf7bcad - <gimli[3bdf8dc921b7251b]::write::str::LineStringTable>::get
  25:     0x7fffabf85493 - <gimli[3bdf8dc921b7251b]::write::str::LineStringTable>::get
  26:     0x7fffac6995d9 - <rayon_core[7162302f1ebc8c42]::registry::WorkerThread>::wait_until_cold
  27:     0x7fffac695e41 - <rayon_core[7162302f1ebc8c42]::registry::ThreadBuilder>::run
  28:     0x7fffaadfa03c - memchr
  29:     0x7fffaade96fd - memchr
  30:     0x7fffaadf9959 - memchr
  31:     0x7ff81a05950d - alloc::boxed::impl$48::call_once
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\alloc\src\boxed.rs:2064
  32:     0x7ff81a05950d - alloc::boxed::impl$48::call_once
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\alloc\src\boxed.rs:2064
  33:     0x7ff81a05950d - std::sys::pal::windows::thread::impl$0::new::thread_start
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\sys\pal\windows\thread.rs:52
  34:     0x7ff869a8257d - BaseThreadInitThunk
  35:     0x7ff86b40af28 - RtlUserThreadStart


rustc version: 1.81.0-nightly (cc8da78a0 2024-07-04)
platform: x86_64-pc-windows-msvc

query stack during panic:
#0 [optimized_mir] optimizing MIR for `fastrand::global_rng::i8`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
jieyouxu

jieyouxu commented on Jul 5, 2024

@jieyouxu
Member

Weirdly, I can't repro:

rustc 1.81.0-nightly (c1b336cb6 2024-06-21): cargo +nightly test twice, no repro
rustc 1.81.0-nightly (cc8da78a0 2024-07-04): cargo +nightly test twice, no repro

rustc 1.81.0-nightly (cc8da78a0 2024-07-04)
binary: rustc
commit-hash: cc8da78a036dc3c15c35a97651b02af9a6d30c1e
commit-date: 2024-07-04
host: x86_64-pc-windows-msvc
release: 1.81.0-nightly
LLVM version: 18.1.7
ChrisDenton

ChrisDenton commented on Jul 5, 2024

@ChrisDenton
Member

I did have to force it to rebuild by touching a file.

jieyouxu

jieyouxu commented on Jul 5, 2024

@jieyouxu
Member

I did have to force it to rebuild by touching a file.

Thanks, that does it for me too:

ICE
   Compiling rantz_random v0.4.5 (E:\Repos\rantz_random)
thread 'rustc' panicked at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e\compiler\rustc_data_structures\src\sync.rs:337:42:
assertion failed: *old == value
stack backtrace:
   0:     0x7ffdfed44d0d - std::backtrace_rs::backtrace::dbghelp64::trace
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\..\..\backtrace\src\backtrace\dbghelp64.rs:91
   1:     0x7ffdfed44d0d - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ffdfed44d0d - std::sys::backtrace::_print_fmt
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\sys\backtrace.rs:68
   3:     0x7ffdfed44d0d - std::sys::backtrace::_print::impl$0::fmt
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\sys\backtrace.rs:44
   4:     0x7ffdfed75399 - core::fmt::rt::Argument::fmt
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\core\src\fmt\rt.rs:173
   5:     0x7ffdfed75399 - core::fmt::write
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\core\src\fmt\mod.rs:1174
   6:     0x7ffdfed3b341 - std::io::Write::write_fmt<std::sys::pal::windows::stdio::Stderr>
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\io\mod.rs:1835
   7:     0x7ffdfed44ae6 - std::sys::backtrace::print
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\sys\backtrace.rs:34
   8:     0x7ffdfed47ce8 - std::panicking::default_hook::closure$1
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\panicking.rs:265
   9:     0x7ffdfed47999 - std::panicking::default_hook
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\panicking.rs:292
  10:     0x7ffdf1f65c15 - memchr
  11:     0x7ffdfed4846b - alloc::boxed::impl$50::call
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\alloc\src\boxed.rs:2078
  12:     0x7ffdfed4846b - std::panicking::rust_panic_with_hook
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\panicking.rs:804
  13:     0x7ffdfed4823f - std::panicking::begin_panic_handler::closure$0
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\panicking.rs:663
  14:     0x7ffdfed4567f - std::sys::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\sys\backtrace.rs:171
  15:     0x7ffdfed47e56 - std::panicking::begin_panic_handler
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\panicking.rs:661
  16:     0x7ffdfed9dd94 - core::panicking::panic_fmt
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\core\src\panicking.rs:74
  17:     0x7ffdfed9de3d - core::panicking::panic
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\core\src\panicking.rs:148
  18:     0x7ffdf09546a2 - <rustc_middle[bdeecb11c8336086]::ty::context::TyCtxt>::set_alloc_id_same_memory
  19:     0x7ffdf08389bb - <rustc_metadata[ad750163167944e7]::rmeta::decoder::DecodeContext as rustc_type_ir[9dfd536501306e43]::codec::TyDecoder>::decode_alloc_id
  20:     0x7ffdf1a387a4 - <aho_corasick[a2225782c592e1d2]::util::prefilter::Builder>::build
  21:     0x7ffdf1a24e2e - <aho_corasick[a2225782c592e1d2]::util::prefilter::Builder>::build
  22:     0x7ffdf1ac2003 - <rustc_metadata[ad750163167944e7]::creader::alloc_error_handler_spans::Finder as rustc_ast[652270f71cc1a825]::visit::Visitor>::visit_item
  23:     0x7ffdf152da13 - rustc_query_impl[ebda40cb8fea939a]::plumbing::query_key_hash_verify_all
  24:     0x7ffdf141b0ee - rustc_ty_utils[ea289ddf2ac2917d]::ty::self_ty_of_trait_impl_enabling_order_dep_trait_object_hack
  25:     0x7ffdf0657c35 - rustc_query_impl[ebda40cb8fea939a]::query_system
  26:     0x7ffdf1e41ff7 - <rustc_middle[bdeecb11c8336086]::ty::context::TyCtxt>::instance_mir
  27:     0x7ffdf19c7543 - rustc_monomorphize[662a250e8978a8be]::is_call_from_compiler_builtins_to_upstream_monomorphization
  28:     0x7ffdf19c4e06 - rustc_monomorphize[662a250e8978a8be]::is_call_from_compiler_builtins_to_upstream_monomorphization
  29:     0x7ffdf19c64de - rustc_monomorphize[662a250e8978a8be]::is_call_from_compiler_builtins_to_upstream_monomorphization
  30:     0x7ffdf30ebcad - <gimli[3bdf8dc921b7251b]::write::str::LineStringTable>::get
  31:     0x7ffdf30f01e6 - <gimli[3bdf8dc921b7251b]::write::str::LineStringTable>::get
  32:     0x7ffdf30ebf68 - <gimli[3bdf8dc921b7251b]::write::str::LineStringTable>::get
  33:     0x7ffdf30f01e6 - <gimli[3bdf8dc921b7251b]::write::str::LineStringTable>::get
  34:     0x7ffdf30ebf68 - <gimli[3bdf8dc921b7251b]::write::str::LineStringTable>::get
  35:     0x7ffdf30f5493 - <gimli[3bdf8dc921b7251b]::write::str::LineStringTable>::get
  36:     0x7ffdf38095d9 - <rayon_core[7162302f1ebc8c42]::registry::WorkerThread>::wait_until_cold
  37:     0x7ffdf3805e41 - <rayon_core[7162302f1ebc8c42]::registry::ThreadBuilder>::run
  38:     0x7ffdf1f6a03c - memchr
  39:     0x7ffdf1f596fd - memchr
  40:     0x7ffdf1f69959 - memchr
  41:     0x7ffdfed5950d - alloc::boxed::impl$48::call_once
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\alloc\src\boxed.rs:2064
  42:     0x7ffdfed5950d - alloc::boxed::impl$48::call_once
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\alloc\src\boxed.rs:2064
  43:     0x7ffdfed5950d - std::sys::pal::windows::thread::impl$0::new::thread_start
                               at /rustc/cc8da78a036dc3c15c35a97651b02af9a6d30c1e/library\std\src\sys\pal\windows\thread.rs:52
  44:     0x7ffe8eee26ad - BaseThreadInitThunk
  45:     0x7ffe8fd6a9f8 - RtlUserThreadStart

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: please make sure that you have updated to the latest nightly

note: please attach the file at `E:\Repos\rantz_random\rustc-ice-2024-07-05T04_25_58-10060.txt` to your bug report

note: compiler flags: --crate-type lib -C opt-level=1 -C embed-bitcode=no -C debuginfo=2 -C debug-assertions=on -C linker=rust-lld.exe -C incremental=[REDACTED] -Z share-generics=n -Z threads=0

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

query stack during panic:
#0 [optimized_mir] optimizing MIR for `fastrand::global_rng::i64`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
error: could not compile `rantz_random` (lib)
warning: build failed, waiting for other jobs to finish...
self-assigned this
on Jul 5, 2024
removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Jul 5, 2024
added
E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
on Jul 5, 2024

21 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)A-incr-compArea: Incremental compilationC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @Nemo157@oli-obk@alecmocatta@BobG1983@ChrisDenton

      Issue actions

        ICE: "assertion failed: *old == value" in optimized + incremental builds · Issue #126741 · rust-lang/rust