Repository: rust
Issue: Internal compiler error & abnormal timing on `misc_checking_3`
Labels: I-ICE,T-compiler,C-bug,S-needs-repro

<!--
Thank you for finding an Internal Compiler Error! 🧊  If possible, try to provide
a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for
how to create smaller examples.
http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/
-->

### Code

Error happened while compiling this example with the stable compiler:

https://github.com/lpotthast/leptonic/tree/main/examples/book

with `trunk build`, performing a debug build.

The error occurs reproducibly (but not with 100% occurrence) when incrementally re-compiling the `book` example after a simple code change. 

`target` folder is 20GB after compilation with stable 1.70. With nightly 1.72 only 3GB.
When incremental compilation did not panic, `target` reached 40GB.
When compiling with nightly, `target` is only 3GB.

Additional behaviour: Incremental compilation is now dramatically slower. 1 minute compared to roughly 10 seconds.
Seems to come from the final crate. Every dependency before  compiles fine.
Running `RUSTFLAGS="-Z time-passes --cfg=web_sys_unstable_apis" trunk build` shows (full output below) that `misc_checking_3` took a full 60 seconds. What could be the cause for that?


### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
rustc 1.70.0 (90c541806 2023-05-31)
binary: rustc
commit-hash: 90c541806f23a127002de5b4038be731ba1458ca
commit-date: 2023-05-31
host: aarch64-apple-darwin
release: 1.70.0
LLVM version: 16.0.2
```

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary><strong>Error output with Backtrace</strong></summary>
<p>

```
Compiling book v0.1.0 (/Users/{...}/dev/{...}/leptonic/examples/book)
thread 'rustc' panicked at 'invalid enum variant tag while decoding `AllocDiscriminant`, expected 0..4', /rustc/90c541806f23a127002de5b4038be731ba1458ca/compiler/rustc_middle/src/mir/interpret/mod.rs:195:10
stack backtrace:
   0:        0x101009864 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h819e9cbdf1a9e730
   1:        0x10105c958 - core::fmt::write::ha5e9bf3131ecb7c0
   2:        0x100fff214 - std::io::Write::write_fmt::h414ce9994bf17404
   3:        0x101009678 - std::sys_common::backtrace::print::h8072db0bbd5bcc3d
   4:        0x10100c08c - std::panicking::default_hook::{{closure}}::h2c85c5b0c2ede151
   5:        0x10100be4c - std::panicking::default_hook::hcf2f70992d02f6fe
   6:        0x109504058 - rustc_driver_impl[783dc85a9905d0e5]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x10100c74c - std::panicking::rust_panic_with_hook::h023af7f90b47eb8b
   8:        0x10100c504 - std::panicking::begin_panic_handler::{{closure}}::h14283519edc1d634
   9:        0x101009c84 - std::sys_common::backtrace::__rust_end_short_backtrace::hc366c0b0cef5b747
  10:        0x10100c2d8 - _rust_begin_unwind
  11:        0x101088400 - core::panicking::panic_fmt::h324f50b29db90195
  12:        0x10c821e74 - <rustc_middle[51dfd5d9279e1028]::mir::interpret::AllocDiscriminant as rustc_serialize[db9eaf7dd3c3300]::serialize::Decodable<rustc_query_impl[7b60fd99fe06ff81]::on_disk_cache::CacheDecoder>>::decode
  13:        0x10c815fcc - <rustc_middle[51dfd5d9279e1028]::mir::interpret::AllocDecodingSession>::decode_alloc_id::<rustc_query_impl[7b60fd99fe06ff81]::on_disk_cache::CacheDecoder>
  14:        0x10c8c1110 - <core[b2c7346eda96f041]::result::Result<rustc_middle[51dfd5d9279e1028]::mir::interpret::value::ConstAlloc, rustc_middle[51dfd5d9279e1028]::mir::interpret::error::ErrorHandled> as rustc_serialize[db9eaf7dd3c3300]::serialize::Decodable<rustc_query_impl[7b60fd99fe06ff81]::on_disk_cache::CacheDecoder>>::decode
  15:        0x10c854294 - <rustc_query_impl[7b60fd99fe06ff81]::on_disk_cache::OnDiskCache>::try_load_query_result::<core[b2c7346eda96f041]::result::Result<rustc_middle[51dfd5d9279e1028]::mir::interpret::value::ConstAlloc, rustc_middle[51dfd5d9279e1028]::mir::interpret::error::ErrorHandled>>
  16:        0x10c7fc2f8 - <<rustc_query_impl[7b60fd99fe06ff81]::queries::eval_to_allocation_raw as rustc_query_system[a624e6a9fe4584df]::query::config::QueryConfig<rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>>::try_load_from_disk::{closure#0} as core[b2c7346eda96f041]::ops::function::FnOnce<(rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt, rustc_query_system[a624e6a9fe4584df]::dep_graph::serialized::SerializedDepNodeIndex)>>::call_once
  17:        0x10c703434 - <rustc_middle[51dfd5d9279e1028]::dep_graph::dep_node::DepKind as rustc_query_system[a624e6a9fe4584df]::dep_graph::DepKind>::with_deps::<rustc_query_system[a624e6a9fe4584df]::query::plumbing::try_load_from_disk_and_cache_in_memory<rustc_query_impl[7b60fd99fe06ff81]::queries::eval_to_allocation_raw, rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>::{closure#0}, core[b2c7346eda96f041]::option::Option<rustc_middle[51dfd5d9279e1028]::query::erase::Erased<[u8; 16usize]>>>
  18:        0x10c79f210 - <std[bf9110f564f42f12]::thread::local::LocalKey<core[b2c7346eda96f041]::cell::Cell<*const ()>>>::with::<rustc_middle[51dfd5d9279e1028]::ty::context::tls::enter_context<rustc_query_system[a624e6a9fe4584df]::query::plumbing::execute_job_incr<rustc_query_impl[7b60fd99fe06ff81]::queries::eval_to_allocation_raw, rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>::{closure#1}, core[b2c7346eda96f041]::option::Option<(rustc_middle[51dfd5d9279e1028]::query::erase::Erased<[u8; 16usize]>, rustc_query_system[a624e6a9fe4584df]::dep_graph::graph::DepNodeIndex)>>::{closure#0}, core[b2c7346eda96f041]::option::Option<(rustc_middle[51dfd5d9279e1028]::query::erase::Erased<[u8; 16usize]>, rustc_query_system[a624e6a9fe4584df]::dep_graph::graph::DepNodeIndex)>>
  19:        0x10c6adffc - rustc_query_system[a624e6a9fe4584df]::query::plumbing::try_execute_query::<rustc_query_impl[7b60fd99fe06ff81]::queries::eval_to_allocation_raw, rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>
  20:        0x10c8dbbfc - <rustc_query_impl[7b60fd99fe06ff81]::Queries as rustc_middle[51dfd5d9279e1028]::ty::query::QueryEngine>::eval_to_allocation_raw
  21:        0x10d3a7458 - <rustc_middle[51dfd5d9279e1028]::ty::query::TyCtxtAt>::eval_static_initializer
  22:        0x10bc2dad8 - rustc_monomorphize[7391447879c1b811]::collector::collect_items_rec
  23:        0x10bc4f1c0 - <core[b2c7346eda96f041]::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures[b0ef732b28d74439]::sync::par_for_each_in<alloc[c0234de1c81d41f3]::vec::Vec<rustc_middle[51dfd5d9279e1028]::mir::mono::MonoItem>, rustc_monomorphize[7391447879c1b811]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}> as core[b2c7346eda96f041]::ops::function::FnOnce<()>>::call_once
  24:        0x10bc3f97c - rustc_data_structures[b0ef732b28d74439]::sync::par_for_each_in::<alloc[c0234de1c81d41f3]::vec::Vec<rustc_middle[51dfd5d9279e1028]::mir::mono::MonoItem>, rustc_monomorphize[7391447879c1b811]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>
  25:        0x10bc47d7c - <rustc_session[fcd7c20a0454c43b]::session::Session>::time::<(), rustc_monomorphize[7391447879c1b811]::collector::collect_crate_mono_items::{closure#1}>
  26:        0x10bc2bee0 - rustc_monomorphize[7391447879c1b811]::collector::collect_crate_mono_items
  27:        0x10bc3d3a8 - rustc_monomorphize[7391447879c1b811]::partitioning::collect_and_partition_mono_items
  28:        0x10c7c8878 - <std[bf9110f564f42f12]::thread::local::LocalKey<core[b2c7346eda96f041]::cell::Cell<*const ()>>>::with::<rustc_middle[51dfd5d9279e1028]::ty::context::tls::enter_context<rustc_query_system[a624e6a9fe4584df]::query::plumbing::execute_job_incr<rustc_query_impl[7b60fd99fe06ff81]::queries::collect_and_partition_mono_items, rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>::{closure#2}, (rustc_middle[51dfd5d9279e1028]::query::erase::Erased<[u8; 24usize]>, rustc_query_system[a624e6a9fe4584df]::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle[51dfd5d9279e1028]::query::erase::Erased<[u8; 24usize]>, rustc_query_system[a624e6a9fe4584df]::dep_graph::graph::DepNodeIndex)>
  29:        0x10c6d130c - rustc_query_system[a624e6a9fe4584df]::query::plumbing::try_execute_query::<rustc_query_impl[7b60fd99fe06ff81]::queries::collect_and_partition_mono_items, rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>
  30:        0x10c8e9904 - <rustc_query_impl[7b60fd99fe06ff81]::Queries as rustc_middle[51dfd5d9279e1028]::ty::query::QueryEngine>::collect_and_partition_mono_items
  31:        0x1096985c4 - rustc_codegen_ssa[45706968ab3d73a1]::base::codegen_crate::<rustc_codegen_llvm[bf1962274a0678a0]::LlvmCodegenBackend>
  32:        0x10969504c - <rustc_codegen_llvm[bf1962274a0678a0]::LlvmCodegenBackend as rustc_codegen_ssa[45706968ab3d73a1]::traits::backend::CodegenBackend>::codegen_crate
  33:        0x1095a7c40 - <rustc_session[fcd7c20a0454c43b]::session::Session>::time::<alloc[c0234de1c81d41f3]::boxed::Box<dyn core[b2c7346eda96f041]::any::Any>, rustc_interface[86097f894d44157]::passes::start_codegen::{closure#0}>
  34:        0x10961e7c4 - rustc_interface[86097f894d44157]::passes::start_codegen
  35:        0x10960c19c - <rustc_middle[51dfd5d9279e1028]::ty::context::GlobalCtxt>::enter::<<rustc_interface[86097f894d44157]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[b2c7346eda96f041]::result::Result<alloc[c0234de1c81d41f3]::boxed::Box<dyn core[b2c7346eda96f041]::any::Any>, rustc_span[350718d478b9eefa]::ErrorGuaranteed>>
  36:        0x1095d61ec - <rustc_interface[86097f894d44157]::queries::Queries>::ongoing_codegen
  37:        0x109554a74 - <rustc_interface[86097f894d44157]::interface::Compiler>::enter::<rustc_driver_impl[783dc85a9905d0e5]::run_compiler::{closure#1}::{closure#2}, core[b2c7346eda96f041]::result::Result<core[b2c7346eda96f041]::option::Option<rustc_interface[86097f894d44157]::queries::Linker>, rustc_span[350718d478b9eefa]::ErrorGuaranteed>>
  38:        0x10950b2cc - rustc_span[350718d478b9eefa]::set_source_map::<core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>, rustc_interface[86097f894d44157]::interface::run_compiler<core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>, rustc_driver_impl[783dc85a9905d0e5]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  39:        0x10951e8a8 - std[bf9110f564f42f12]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[86097f894d44157]::util::run_in_thread_pool_with_globals<rustc_interface[86097f894d44157]::interface::run_compiler<core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>, rustc_driver_impl[783dc85a9905d0e5]::run_compiler::{closure#1}>::{closure#0}, core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>>
  40:        0x10950fa78 - <<std[bf9110f564f42f12]::thread::Builder>::spawn_unchecked_<rustc_interface[86097f894d44157]::util::run_in_thread_pool_with_globals<rustc_interface[86097f894d44157]::interface::run_compiler<core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>, rustc_driver_impl[783dc85a9905d0e5]::run_compiler::{closure#1}>::{closure#0}, core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>>::{closure#1} as core[b2c7346eda96f041]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  41:        0x101014df4 - std::sys::unix::thread::Thread::new::thread_start::h7f56b35fafcfec87
  42:        0x18fbbffa8 - __pthread_joiner_wake

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.70.0 (90c541806 2023-05-31) running on aarch64-apple-darwin

note: compiler flags: --crate-type bin -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:
thread 'rustc' panicked at 'Illegal read of: 42519', /rustc/90c541806f23a127002de5b4038be731ba1458ca/compiler/rustc_query_system/src/dep_graph/graph.rs:482:25
stack backtrace:
   0:        0x101009864 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h819e9cbdf1a9e730
   1:        0x10105c958 - core::fmt::write::ha5e9bf3131ecb7c0
   2:        0x100fff214 - std::io::Write::write_fmt::h414ce9994bf17404
   3:        0x101009678 - std::sys_common::backtrace::print::h8072db0bbd5bcc3d
   4:        0x10100c08c - std::panicking::default_hook::{{closure}}::h2c85c5b0c2ede151
   5:        0x10100be4c - std::panicking::default_hook::hcf2f70992d02f6fe
   6:        0x109504058 - rustc_driver_impl[783dc85a9905d0e5]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x10100c74c - std::panicking::rust_panic_with_hook::h023af7f90b47eb8b
   8:        0x10100c544 - std::panicking::begin_panic_handler::{{closure}}::h14283519edc1d634
   9:        0x101009c84 - std::sys_common::backtrace::__rust_end_short_backtrace::hc366c0b0cef5b747
  10:        0x10100c2d8 - _rust_begin_unwind
  11:        0x101088400 - core::panicking::panic_fmt::h324f50b29db90195
  12:        0x10d31d60c - <rustc_middle[51dfd5d9279e1028]::dep_graph::dep_node::DepKind as rustc_query_system[a624e6a9fe4584df]::dep_graph::DepKind>::read_deps::<<rustc_query_system[a624e6a9fe4584df]::dep_graph::graph::DepGraph<rustc_middle[51dfd5d9279e1028]::dep_graph::dep_node::DepKind>>::read_index::{closure#0}>
  13:        0x10d4308a8 - <rustc_middle[51dfd5d9279e1028]::ty::context::TyCtxt>::type_length_limit
  14:        0x10d425128 - <rustc_middle[51dfd5d9279e1028]::ty::context::TyCtxt>::def_path_str
  15:        0x10d3043a4 - <rustc_middle[51dfd5d9279e1028]::mir::interpret::GlobalId>::display
  16:        0x10d3b7994 - rustc_middle[51dfd5d9279e1028]::query::descs::eval_to_allocation_raw
  17:        0x10c88fb98 - rustc_query_impl[7b60fd99fe06ff81]::plumbing::create_query_frame::<rustc_middle[51dfd5d9279e1028]::ty::ParamEnvAnd<rustc_middle[51dfd5d9279e1028]::mir::interpret::GlobalId>>
  18:        0x10c729094 - <rustc_query_impl[7b60fd99fe06ff81]::query_structs::eval_to_allocation_raw::{closure#0} as core[b2c7346eda96f041]::ops::function::FnOnce<(rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt, &mut std[bf9110f564f42f12]::collections::hash::map::HashMap<rustc_query_system[a624e6a9fe4584df]::query::job::QueryJobId, rustc_query_system[a624e6a9fe4584df]::query::job::QueryJobInfo<rustc_middle[51dfd5d9279e1028]::dep_graph::dep_node::DepKind>, core[b2c7346eda96f041]::hash::BuildHasherDefault<rustc_hash[1a479c81c1cf07d9]::FxHasher>>)>>::call_once
  19:        0x10c7e74b4 - rustc_query_system[a624e6a9fe4584df]::query::job::print_query_stack::<rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>
  20:        0x10960b518 - rustc_interface[86097f894d44157]::interface::try_print_query_stack
  21:        0x1095048f0 - rustc_driver_impl[783dc85a9905d0e5]::report_ice
  22:        0x109504094 - rustc_driver_impl[783dc85a9905d0e5]::DEFAULT_HOOK::{closure#0}::{closure#0}
  23:        0x10100c74c - std::panicking::rust_panic_with_hook::h023af7f90b47eb8b
  24:        0x10100c504 - std::panicking::begin_panic_handler::{{closure}}::h14283519edc1d634
  25:        0x101009c84 - std::sys_common::backtrace::__rust_end_short_backtrace::hc366c0b0cef5b747
  26:        0x10100c2d8 - _rust_begin_unwind
  27:        0x101088400 - core::panicking::panic_fmt::h324f50b29db90195
  28:        0x10c821e74 - <rustc_middle[51dfd5d9279e1028]::mir::interpret::AllocDiscriminant as rustc_serialize[db9eaf7dd3c3300]::serialize::Decodable<rustc_query_impl[7b60fd99fe06ff81]::on_disk_cache::CacheDecoder>>::decode
  29:        0x10c815fcc - <rustc_middle[51dfd5d9279e1028]::mir::interpret::AllocDecodingSession>::decode_alloc_id::<rustc_query_impl[7b60fd99fe06ff81]::on_disk_cache::CacheDecoder>
  30:        0x10c8c1110 - <core[b2c7346eda96f041]::result::Result<rustc_middle[51dfd5d9279e1028]::mir::interpret::value::ConstAlloc, rustc_middle[51dfd5d9279e1028]::mir::interpret::error::ErrorHandled> as rustc_serialize[db9eaf7dd3c3300]::serialize::Decodable<rustc_query_impl[7b60fd99fe06ff81]::on_disk_cache::CacheDecoder>>::decode
  31:        0x10c854294 - <rustc_query_impl[7b60fd99fe06ff81]::on_disk_cache::OnDiskCache>::try_load_query_result::<core[b2c7346eda96f041]::result::Result<rustc_middle[51dfd5d9279e1028]::mir::interpret::value::ConstAlloc, rustc_middle[51dfd5d9279e1028]::mir::interpret::error::ErrorHandled>>
  32:        0x10c7fc2f8 - <<rustc_query_impl[7b60fd99fe06ff81]::queries::eval_to_allocation_raw as rustc_query_system[a624e6a9fe4584df]::query::config::QueryConfig<rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>>::try_load_from_disk::{closure#0} as core[b2c7346eda96f041]::ops::function::FnOnce<(rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt, rustc_query_system[a624e6a9fe4584df]::dep_graph::serialized::SerializedDepNodeIndex)>>::call_once
  33:        0x10c703434 - <rustc_middle[51dfd5d9279e1028]::dep_graph::dep_node::DepKind as rustc_query_system[a624e6a9fe4584df]::dep_graph::DepKind>::with_deps::<rustc_query_system[a624e6a9fe4584df]::query::plumbing::try_load_from_disk_and_cache_in_memory<rustc_query_impl[7b60fd99fe06ff81]::queries::eval_to_allocation_raw, rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>::{closure#0}, core[b2c7346eda96f041]::option::Option<rustc_middle[51dfd5d9279e1028]::query::erase::Erased<[u8; 16usize]>>>
  34:        0x10c79f210 - <std[bf9110f564f42f12]::thread::local::LocalKey<core[b2c7346eda96f041]::cell::Cell<*const ()>>>::with::<rustc_middle[51dfd5d9279e1028]::ty::context::tls::enter_context<rustc_query_system[a624e6a9fe4584df]::query::plumbing::execute_job_incr<rustc_query_impl[7b60fd99fe06ff81]::queries::eval_to_allocation_raw, rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>::{closure#1}, core[b2c7346eda96f041]::option::Option<(rustc_middle[51dfd5d9279e1028]::query::erase::Erased<[u8; 16usize]>, rustc_query_system[a624e6a9fe4584df]::dep_graph::graph::DepNodeIndex)>>::{closure#0}, core[b2c7346eda96f041]::option::Option<(rustc_middle[51dfd5d9279e1028]::query::erase::Erased<[u8; 16usize]>, rustc_query_system[a624e6a9fe4584df]::dep_graph::graph::DepNodeIndex)>>
  35:        0x10c6adffc - rustc_query_system[a624e6a9fe4584df]::query::plumbing::try_execute_query::<rustc_query_impl[7b60fd99fe06ff81]::queries::eval_to_allocation_raw, rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>
  36:        0x10c8dbbfc - <rustc_query_impl[7b60fd99fe06ff81]::Queries as rustc_middle[51dfd5d9279e1028]::ty::query::QueryEngine>::eval_to_allocation_raw
  37:        0x10d3a7458 - <rustc_middle[51dfd5d9279e1028]::ty::query::TyCtxtAt>::eval_static_initializer
  38:        0x10bc2dad8 - rustc_monomorphize[7391447879c1b811]::collector::collect_items_rec
  39:        0x10bc4f1c0 - <core[b2c7346eda96f041]::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures[b0ef732b28d74439]::sync::par_for_each_in<alloc[c0234de1c81d41f3]::vec::Vec<rustc_middle[51dfd5d9279e1028]::mir::mono::MonoItem>, rustc_monomorphize[7391447879c1b811]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}> as core[b2c7346eda96f041]::ops::function::FnOnce<()>>::call_once
  40:        0x10bc3f97c - rustc_data_structures[b0ef732b28d74439]::sync::par_for_each_in::<alloc[c0234de1c81d41f3]::vec::Vec<rustc_middle[51dfd5d9279e1028]::mir::mono::MonoItem>, rustc_monomorphize[7391447879c1b811]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>
  41:        0x10bc47d7c - <rustc_session[fcd7c20a0454c43b]::session::Session>::time::<(), rustc_monomorphize[7391447879c1b811]::collector::collect_crate_mono_items::{closure#1}>
  42:        0x10bc2bee0 - rustc_monomorphize[7391447879c1b811]::collector::collect_crate_mono_items
  43:        0x10bc3d3a8 - rustc_monomorphize[7391447879c1b811]::partitioning::collect_and_partition_mono_items
  44:        0x10c7c8878 - <std[bf9110f564f42f12]::thread::local::LocalKey<core[b2c7346eda96f041]::cell::Cell<*const ()>>>::with::<rustc_middle[51dfd5d9279e1028]::ty::context::tls::enter_context<rustc_query_system[a624e6a9fe4584df]::query::plumbing::execute_job_incr<rustc_query_impl[7b60fd99fe06ff81]::queries::collect_and_partition_mono_items, rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>::{closure#2}, (rustc_middle[51dfd5d9279e1028]::query::erase::Erased<[u8; 24usize]>, rustc_query_system[a624e6a9fe4584df]::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle[51dfd5d9279e1028]::query::erase::Erased<[u8; 24usize]>, rustc_query_system[a624e6a9fe4584df]::dep_graph::graph::DepNodeIndex)>
  45:        0x10c6d130c - rustc_query_system[a624e6a9fe4584df]::query::plumbing::try_execute_query::<rustc_query_impl[7b60fd99fe06ff81]::queries::collect_and_partition_mono_items, rustc_query_impl[7b60fd99fe06ff81]::plumbing::QueryCtxt>
  46:        0x10c8e9904 - <rustc_query_impl[7b60fd99fe06ff81]::Queries as rustc_middle[51dfd5d9279e1028]::ty::query::QueryEngine>::collect_and_partition_mono_items
  47:        0x1096985c4 - rustc_codegen_ssa[45706968ab3d73a1]::base::codegen_crate::<rustc_codegen_llvm[bf1962274a0678a0]::LlvmCodegenBackend>
  48:        0x10969504c - <rustc_codegen_llvm[bf1962274a0678a0]::LlvmCodegenBackend as rustc_codegen_ssa[45706968ab3d73a1]::traits::backend::CodegenBackend>::codegen_crate
  49:        0x1095a7c40 - <rustc_session[fcd7c20a0454c43b]::session::Session>::time::<alloc[c0234de1c81d41f3]::boxed::Box<dyn core[b2c7346eda96f041]::any::Any>, rustc_interface[86097f894d44157]::passes::start_codegen::{closure#0}>
  50:        0x10961e7c4 - rustc_interface[86097f894d44157]::passes::start_codegen
  51:        0x10960c19c - <rustc_middle[51dfd5d9279e1028]::ty::context::GlobalCtxt>::enter::<<rustc_interface[86097f894d44157]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[b2c7346eda96f041]::result::Result<alloc[c0234de1c81d41f3]::boxed::Box<dyn core[b2c7346eda96f041]::any::Any>, rustc_span[350718d478b9eefa]::ErrorGuaranteed>>
  52:        0x1095d61ec - <rustc_interface[86097f894d44157]::queries::Queries>::ongoing_codegen
  53:        0x109554a74 - <rustc_interface[86097f894d44157]::interface::Compiler>::enter::<rustc_driver_impl[783dc85a9905d0e5]::run_compiler::{closure#1}::{closure#2}, core[b2c7346eda96f041]::result::Result<core[b2c7346eda96f041]::option::Option<rustc_interface[86097f894d44157]::queries::Linker>, rustc_span[350718d478b9eefa]::ErrorGuaranteed>>
  54:        0x10950b2cc - rustc_span[350718d478b9eefa]::set_source_map::<core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>, rustc_interface[86097f894d44157]::interface::run_compiler<core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>, rustc_driver_impl[783dc85a9905d0e5]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  55:        0x10951e8a8 - std[bf9110f564f42f12]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[86097f894d44157]::util::run_in_thread_pool_with_globals<rustc_interface[86097f894d44157]::interface::run_compiler<core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>, rustc_driver_impl[783dc85a9905d0e5]::run_compiler::{closure#1}>::{closure#0}, core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>>
  56:        0x10950fa78 - <<std[bf9110f564f42f12]::thread::Builder>::spawn_unchecked_<rustc_interface[86097f894d44157]::util::run_in_thread_pool_with_globals<rustc_interface[86097f894d44157]::interface::run_compiler<core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>, rustc_driver_impl[783dc85a9905d0e5]::run_compiler::{closure#1}>::{closure#0}, core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b2c7346eda96f041]::result::Result<(), rustc_span[350718d478b9eefa]::ErrorGuaranteed>>::{closure#1} as core[b2c7346eda96f041]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  57:        0x101014df4 - std::sys::unix::thread::Thread::new::thread_start::h7f56b35fafcfec87
  58:        0x18fbbffa8 - __pthread_joiner_wake

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.70.0 (90c541806 2023-05-31) running on aarch64-apple-darwin

note: compiler flags: --crate-type bin -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:
end of query stack
thread panicked while panicking. aborting.
```

</p>
</details>


<details><summary><strong>Compilation timings</strong></summary>
<p>

```
Compiling book v0.1.0 (/Users/lukaspotthast/dev/fcs/leptonic/examples/book)
time:   0.000; rss:   33MB ->   34MB (   +1MB)  parse_crate
time:   0.053; rss:   34MB ->   34MB (   +0MB)  incr_comp_prepare_session_directory
time:   0.000; rss:   34MB ->   35MB (   +0MB)  incr_comp_garbage_collect_session_directories
time:   0.000; rss:   35MB ->   35MB (   +0MB)  plugin_loading
time:   0.149; rss:   35MB ->  330MB ( +295MB)  blocked_on_dep_graph_loading
time:   0.000; rss:  372MB ->  373MB (   +1MB)  setup_global_ctxt
time:   0.000; rss:  374MB ->  374MB (   +0MB)  crate_injection
time:   0.302; rss:  374MB ->  491MB ( +117MB)  expand_crate
time:   0.302; rss:  374MB ->  491MB ( +117MB)  macro_expand_crate
time:   0.011; rss:  491MB ->  491MB (   +0MB)  AST_validation
time:   0.001; rss:  491MB ->  492MB (   +1MB)  finalize_imports
time:   0.000; rss:  492MB ->  492MB (   +0MB)  compute_effective_visibilities
time:   0.003; rss:  492MB ->  493MB (   +1MB)  finalize_macro_resolutions
time:   0.056; rss:  493MB ->  517MB (  +24MB)  late_resolve_crate
time:   0.000; rss:  517MB ->  517MB (   +0MB)  resolve_report_errors
time:   0.004; rss:  517MB ->  517MB (   +0MB)  resolve_postprocess
time:   0.066; rss:  491MB ->  517MB (  +26MB)  resolve_crate
time:   0.003; rss:  517MB ->  517MB (   +0MB)  prepare_outputs
time:   0.003; rss:  518MB ->  518MB (   +0MB)  complete_gated_feature_checking
time:   0.016; rss:  554MB ->  554MB (   +0MB)  drop_ast
time:   0.137; rss:  517MB ->  545MB (  +28MB)  looking_for_entry_point
time:   0.000; rss:  545MB ->  545MB (   +0MB)  looking_for_derive_registrar
time:   0.000; rss:  547MB ->  547MB (   +0MB)  unused_lib_feature_checking
time:   0.147; rss:  517MB ->  547MB (  +30MB)  misc_checking_1
time:   0.006; rss:  547MB ->  549MB (   +2MB)  type_collecting
time:   0.000; rss:  549MB ->  549MB (   +0MB)  impl_wf_inference
time:   0.008; rss:  549MB ->  553MB (   +3MB)  coherence_checking
time:   0.002; rss:  553MB ->  553MB (   +0MB)  wf_checking
time:   0.000; rss:  601MB ->  601MB (   +0MB)  CheckPackedRef
time:   0.000; rss:  601MB ->  601MB (   +0MB)  CheckConstItemMutation
time:   0.000; rss:  601MB ->  601MB (   +0MB)  FunctionItemReferences
time:   0.000; rss:  601MB ->  601MB (   +0MB)  SimplifyCfg-initial
time:   0.000; rss:  601MB ->  601MB (   +0MB)  SanityCheck
time:   0.000; rss:  601MB ->  601MB (   +0MB)  PromoteTemps
time:   0.000; rss:  604MB ->  604MB (   +0MB)  FunctionItemReferences
time:   0.279; rss:  553MB ->  614MB (  +61MB)  item_types_checking
time:   0.304; rss:  547MB ->  614MB (  +67MB)  type_check_crate
time:   0.000; rss:  615MB ->  615MB (   +0MB)  Derefer
time:   0.000; rss:  615MB ->  615MB (   +0MB)  AddCallGuards
time:   0.000; rss:  615MB ->  615MB (   +0MB)  ElaborateDrops
time:   0.000; rss:  615MB ->  615MB (   +0MB)  AbortUnwindingCalls
time:   0.000; rss:  615MB ->  615MB (   +0MB)  AddMovesForPackedDrops
time:   0.000; rss:  615MB ->  615MB (   +0MB)  ElaborateBoxDerefs
time:   0.000; rss:  615MB ->  615MB (   +0MB)  StateTransform
time:   0.001; rss:  615MB ->  616MB (   +1MB)  ConstProp
time:   0.030; rss:  614MB ->  616MB (   +2MB)  MIR_effect_checking
time:   0.012; rss:  662MB ->  662MB (   +0MB)  crate_lints
time:   0.001; rss:  662MB ->  663MB (   +0MB)  module_lints
time:   0.013; rss:  662MB ->  663MB (   +0MB)  lint_checking
time:   0.008; rss:  663MB ->  663MB (   +0MB)  privacy_checking_modules
time:  60.734; rss:  616MB ->  663MB (  +47MB)  misc_checking_3
time:   0.001; rss:  663MB ->  663MB (   +0MB)  monomorphization_collector_root_collections
time:   0.000; rss:  681MB ->  681MB (   +0MB)  AbortUnwindingCalls
time:   0.000; rss:  686MB ->  686MB (   +0MB)  AbortUnwindingCalls
time:   0.000; rss:  709MB ->  709MB (   +0MB)  CopyProp
time:   0.000; rss:  709MB ->  709MB (   +0MB)  SimplifyComparisonIntegral
time:   0.000; rss:  735MB ->  735MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  736MB ->  736MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  738MB ->  738MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  740MB ->  740MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  742MB ->  742MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  743MB ->  743MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  757MB ->  757MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  768MB ->  768MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  773MB ->  773MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  783MB ->  783MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  784MB ->  784MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  789MB ->  789MB (   +0MB)  AddCallGuards
time:   0.000; rss:  790MB ->  790MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  790MB ->  790MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  791MB ->  791MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  791MB ->  791MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  791MB ->  791MB (   +0MB)  AbortUnwindingCalls
time:   0.000; rss:  792MB ->  792MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  792MB ->  792MB (   +0MB)  AddCallGuards
time:   0.000; rss:  792MB ->  792MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  792MB ->  792MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  806MB ->  806MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  806MB ->  806MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  807MB ->  807MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  808MB ->  808MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  830MB ->  830MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  830MB ->  830MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  831MB ->  831MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  831MB ->  831MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  831MB ->  831MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  832MB ->  833MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  833MB ->  833MB (   +0MB)  AddMovesForPackedDrops
time:   0.000; rss:  834MB ->  834MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  834MB ->  834MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  835MB ->  835MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  836MB ->  836MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  836MB ->  836MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  838MB ->  838MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  844MB ->  844MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  849MB ->  849MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  850MB ->  850MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  850MB ->  850MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  852MB ->  852MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  853MB ->  853MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  853MB ->  853MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  856MB ->  856MB (   +0MB)  AddCallGuards
time:   0.000; rss:  856MB ->  856MB (   +0MB)  AddCallGuards
time:   0.000; rss:  859MB ->  859MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  859MB ->  859MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  866MB ->  866MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  866MB ->  866MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  868MB ->  868MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  870MB ->  870MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  870MB ->  870MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  872MB ->  873MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  873MB ->  873MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  875MB ->  875MB (   +0MB)  AddCallGuards
time:   0.000; rss:  875MB ->  875MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  877MB ->  877MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  879MB ->  879MB (   +0MB)  SimplifyCfg-make_shim
time:   0.000; rss:  880MB ->  880MB (   +0MB)  AddCallGuards
time:   0.000; rss:  904MB ->  904MB (   +0MB)  Derefer
time:   1.180; rss:  663MB ->  957MB ( +294MB)  monomorphization_collector_graph_walk
time:   0.350; rss:  957MB -> 1030MB (  +73MB)  partition_and_assert_distinct_symbols
time:   0.000; rss:  997MB ->  997MB (   +1MB)  write_allocator_module
time:   0.068; rss:  997MB -> 1000MB (   +3MB)  find_cgu_reuse
time:   0.006; rss: 1000MB -> 1007MB (   +7MB)  codegen_to_LLVM_IR
time:   1.694; rss:  663MB -> 1007MB ( +344MB)  codegen_crate
time:   0.055; rss: 1000MB -> 1007MB (   +7MB)  LLVM_passes
time:   0.000; rss: 1007MB -> 1007MB (   +0MB)  assert_dep_graph
time:   0.002; rss:  951MB ->  952MB (   +1MB)  encode_query_results_for(type_of)
time:   0.003; rss:  952MB ->  952MB (   +0MB)  encode_query_results_for(generics_of)
time:   0.001; rss:  952MB ->  953MB (   +0MB)  encode_query_results_for(predicates_of)
time:   0.000; rss:  953MB ->  953MB (   +0MB)  encode_query_results_for(explicit_item_bounds)
time:   0.000; rss:  953MB ->  953MB (   +0MB)  encode_query_results_for(mir_const_qualif)
time:   0.044; rss:  953MB ->  955MB (   +2MB)  encode_query_results_for(optimized_mir)
time:   0.005; rss:  955MB ->  955MB (   +0MB)  encode_query_results_for(promoted_mir)
time:   0.001; rss:  955MB ->  956MB (   +1MB)  encode_query_results_for(explicit_predicates_of)
time:   0.000; rss:  956MB ->  956MB (   +0MB)  encode_query_results_for(inferred_outlives_of)
time:   0.000; rss:  956MB ->  956MB (   +0MB)  encode_query_results_for(associated_item)
time:   0.000; rss:  956MB ->  956MB (   +0MB)  encode_query_results_for(unsafety_check_result)
time:   0.000; rss:  956MB ->  956MB (   +0MB)  encode_query_results_for(thir_check_unsafety)
time:   0.015; rss:  956MB ->  956MB (   +0MB)  encode_query_results_for(typeck)
time:   0.000; rss:  956MB ->  957MB (   +0MB)  encode_query_results_for(used_trait_imports)
time:   0.000; rss:  957MB ->  957MB (   +0MB)  encode_query_results_for(mir_borrowck)
time:   0.003; rss:  957MB ->  960MB (   +3MB)  encode_query_results_for(eval_to_const_value_raw)
time:   0.000; rss:  960MB ->  960MB (   +0MB)  encode_query_results_for(check_match)
time:   0.019; rss:  960MB ->  966MB (   +6MB)  encode_query_results_for(symbol_name)
time:   0.000; rss:  966MB ->  967MB (   +0MB)  encode_query_results_for(opt_def_kind)
time:   0.001; rss:  967MB ->  967MB (   +0MB)  encode_query_results_for(def_span)
time:   0.000; rss:  967MB ->  967MB (   +0MB)  encode_query_results_for(lookup_stability)
time:   0.000; rss:  967MB ->  967MB (   +0MB)  encode_query_results_for(lookup_deprecation_entry)
time:   0.001; rss:  967MB ->  967MB (   +0MB)  encode_query_results_for(codegen_fn_attrs)
time:   0.007; rss:  967MB ->  968MB (   +1MB)  encode_query_results_for(codegen_select_candidate)
time:   0.000; rss:  968MB ->  968MB (   +0MB)  encode_query_results_for(has_ffi_unwind_calls)
time:   0.000; rss:  968MB ->  968MB (   +0MB)  encode_query_results_for(is_reachable_non_generic)
time:   0.108; rss:  951MB ->  968MB (  +17MB)  encode_query_results
time:   0.124; rss:  951MB ->  952MB (   +0MB)  incr_comp_serialize_result_cache
time:   0.221; rss: 1007MB ->  952MB (  -55MB)  incr_comp_persist_result_cache
time:   0.224; rss: 1007MB ->  952MB (  -55MB)  serialize_dep_graph
time:   0.025; rss:  952MB ->  745MB ( -207MB)  free_global_ctxt
time:   0.000; rss:  745MB ->  745MB (   +0MB)  join_worker_thread
time:   0.065; rss:  745MB ->  745MB (   +0MB)  copy_all_cgu_workproducts_to_incr_comp_cache_dir
time:   0.065; rss:  745MB ->  745MB (   +0MB)  finish_ongoing_codegen
time:   0.010; rss:  388MB ->  388MB (   +0MB)  incr_comp_finalize_session_directory
time:   0.789; rss:  389MB ->  389MB (   +0MB)  run_linker
time:   0.011; rss:  389MB ->  389MB (   +0MB)  link_binary_remove_temps
time:   0.810; rss:  388MB ->  389MB (   +1MB)  link_binary
time:   0.811; rss:  388MB ->  381MB (   -7MB)  link_crate
time:   0.891; rss:  745MB ->  381MB ( -364MB)  link
time:  64.665; rss:   20MB ->   83MB (  +63MB)  total
    Finished dev [unoptimized + debuginfo] target(s) in 1m 25s
```

</p>
</details>