rust-lang / rust-lang/rust

[ICE]: thread 'rustc' (20800) panicked at /rust/deps\ena-0.14.3\src\snapshot_vec.rs:53:17

Open
#153,716 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-inference A-trait-system C-bug I-ICE needs-triage S-needs-repro T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

thread 'rustc' (20800) panicked at /rust/deps\ena-0.14.3\src\snapshot_vec.rs:53:17:
assertion failed: Vec::len(self) == i
stack backtrace:
   0:     0x7ffbf83145d2 - std::backtrace_rs::backtrace::win64::trace
                               at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library\std\src\..\..\backtrace\src\backtrace\win64.rs:85
   1:     0x7ffbf83145d2 - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ffbf83145d2 - std::sys::backtrace::_print_fmt
                               at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library\std\src\sys\backtrace.rs:74
   3:     0x7ffbf83145d2 - std::sys::backtrace::impl$0::print::impl$0::fmt
                               at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library\std\src\sys\backtrace.rs:44
   4:     0x7ffbf83298a1 - core::fmt::write
                               at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library\core\src\fmt\mod.rs:0  
   5:     0x7ffbf82dbae4 - std::io::default_write_fmt
                               at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library\std\src\io\mod.rs:639  
   6:     0x7ffbf82dbae4 - std::io::Write::write_fmt<std::sys::stdio::windows::Stderr>
                               at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library\std\src\io\mod.rs:1994 
   7:     0x7ffbf82fcf40 - std::sys::backtrace::BacktraceLock::print
                               at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library\std\src\sys\backtrace.rs:47
   8:     0x7ffbf82fcf40 - std::panicking::default_hook::closure$0
                               at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library\std\src\panicking.rs:292
   9:     0x7ffbf82fcd58 - std::panicking::default_hook
                               at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library\std\src\panicking.rs:319
  10:     0x7ffbf9acd689 - core[1860f69c40542218]::slice::sort::unstable::heapsort::heapsort::<((rustc_lint_defs[7675aa0932531c3a]::Level, &str), usize), <((rustc_lint_defs[7675aa0932531c3a]::Level, &str), usize) as core[1860f69c40542218]::cmp::PartialOrd>::lt>
  11:     0x7ffbf82fd2b1 - std::panicking::panic_with_hook
                               at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library\std\src\panicking.rs:833
  12:     0x7ffbf82fd049 - std::panicking::panic_handler::closure$0
                               at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library\std\src\panicking.rs:691
  13:     0x7ffbf82f4abf - std::sys::backtrace::__rust_end_short_backtrace<std::panicking::panic_handler::closure_env$0,never$>
                               at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library\std\src\sys\backtrace.rs:182
  14:     0x7ffbf82d60de - std::panicking::panic_handler
                               at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library\std\src\panicking.rs:689
  15:     0x7ffbfc549b3d - core::panicking::panic_fmt
                               at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library\core\src\panicking.rs:80
  16:     0x7ffbfc549b07 - core::panicking::panic
                               at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library\core\src\panicking.rs:150
  17:     0x7ffbf94c4bc1 - <rustc_infer[9d33c575024ef4f5]::infer::InferCtxt>::rollback_to
  18:     0x7ffbf934e0ac - RINvNvXsF_CshYMVBdHUrmP_8thin_vecINtB8_8IntoIterpENtNtNtCs25LAAAjbyGa_4core3ops4drop4Drop4drop18drop_non_singletonTINtNtCsduMATfwDN6j_11rustc_infer6traits10ObligationNtNtNtCslbwbWu2vEFm_12rustc_middle2ty9predicate9PredicateEINtNtBS_6option6OptionINtNtCs6Dx
  19:     0x7ffbf9400acf - rustc_trait_selection[1e73743279395158]::traits::project::normalize_projection_term   
  20:     0x7ffbf9462847 - <rustc_trait_selection[1e73743279395158]::traits::normalize::AssocTypeNormalizer as rustc_type_ir[4c953e587688ded6]::fold::TypeFolder<rustc_middle[f6c398a2b1747a0e]::ty::context::TyCtxt>>::fold_ty   
  21:     0x7ffbf92fd5c9 - RINvNvXsF_CshYMVBdHUrmP_8thin_vecINtB8_8IntoIterpENtNtNtCs25LAAAjbyGa_4core3ops4drop4Drop4drop18drop_non_singletonTINtNtCsduMATfwDN6j_11rustc_infer6traits10ObligationNtNtNtCslbwbWu2vEFm_12rustc_middle2ty9predicate9PredicateEINtNtBS_6option6OptionINtNtCs6Dx
  22:     0x7ffbf936fc31 - <rustc_trait_selection[1e73743279395158]::traits::engine::ObligationCtxt<rustc_trait_selection[1e73743279395158]::traits::FulfillmentError>>::new_with_diagnostics
  23:     0x7ffbf93126a8 - RINvNvXsF_CshYMVBdHUrmP_8thin_vecINtB8_8IntoIterpENtNtNtCs25LAAAjbyGa_4core3ops4drop4Drop4drop18drop_non_singletonTINtNtCsduMATfwDN6j_11rustc_infer6traits10ObligationNtNtNtCslbwbWu2vEFm_12rustc_middle2ty9predicate9PredicateEINtNtBS_6option6OptionINtNtCs6Dx
  24:     0x7ffbf934e004 - RINvNvXsF_CshYMVBdHUrmP_8thin_vecINtB8_8IntoIterpENtNtNtCs25LAAAjbyGa_4core3ops4drop4Drop4drop18drop_non_singletonTINtNtCsduMATfwDN6j_11rustc_infer6traits10ObligationNtNtNtCslbwbWu2vEFm_12rustc_middle2ty9predicate9PredicateEINtNtBS_6option6OptionINtNtCs6Dx
  25:     0x7ffbf93cdeb6 - <rustc_trait_selection[1e73743279395158]::traits::select::SelectionContext>::evaluate_root_obligation
  26:     0x7ffbf93c7723 - <rustc_trait_selection[1e73743279395158]::traits::select::SelectionContext>::evaluate_root_obligation
  27:     0x7ffbf8be6ae9 - rustc_traits[870df25fe62e0414]::evaluate_obligation::evaluate_obligation
  28:     0x7ffbf91287ae - RINvMs6_NtCshrezU2Ub55M_9hashbrown3rawINtB6_8RawTableTTNtNtNtCslbwbWu2vEFm_12rustc_middle2ty8instance8InstanceNtNtNtBX_3mir4mono14CollectionModeETINtNtNtBX_5query5erase6ErasedAhj20_ENtNtNtCsdNFGO0zp5uH_18rustc_query_system9dep_graph5graph12DepNodeIndexEEE1
  29:     0x7ffbf9161645 - RINvNtNtCsdNFGO0zp5uH_18rustc_query_system5query8plumbing17try_execute_queryINtCs6AhV3Iizo1R_16rustc_query_impl13DynamicConfigINtNtB4_6caches12DefaultCacheINtNtCs6zEgmM7F2Sg_13rustc_type_ir9canonical19CanonicalQueryInputNtNtNtCslbwbWu2vEFm_12rustc_middle2t
  30:     0x7ffbf91ed500 - rustc_query_impl[4cb40144551fb19d]::plumbing::query_key_hash_verify_all
  31:     0x7ffbf94326db - <rustc_infer[9d33c575024ef4f5]::infer::InferCtxt as rustc_trait_selection[1e73743279395158]::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation_no_overflow
  32:     0x7ffbf9432059 - <rustc_infer[9d33c575024ef4f5]::infer::InferCtxt as rustc_trait_selection[1e73743279395158]::traits::query::evaluate_obligation::InferCtxtExt>::predicate_may_hold
  33:     0x7ffbf8499ed5 - <hashbrown[e2b63d2d2398afe6]::raw::RawTable<usize>>::reserve_rehash::<indexmap[e311de0fb82bc327]::map::core::get_hash<(rustc_middle[f6c398a2b1747a0e]::ty::predicate::Predicate, rustc_middle[f6c398a2b1747a0e]::traits::ObligationCause), ()>::{closure#0}>
  34:     0x7ffbf85dee56 - rustc_hir_typeck[dc7e216ee0ac6f70]::typeck
  35:     0x7ffbf85f1aa7 - rustc_hir_typeck[dc7e216ee0ac6f70]::typeck
  36:     0x7ffbf8546e32 - rustc_hir_typeck[dc7e216ee0ac6f70]::typeck
  37:     0x7ffbf8500ad3 - rustc_hir_typeck[dc7e216ee0ac6f70]::typeck
  38:     0x7ffbf851d1e5 - rustc_hir_typeck[dc7e216ee0ac6f70]::typeck
  39:     0x7ffbf8500a17 - rustc_hir_typeck[dc7e216ee0ac6f70]::typeck
  40:     0x7ffbf851d1e5 - rustc_hir_typeck[dc7e216ee0ac6f70]::typeck
  41:     0x7ffbf8500a17 - rustc_hir_typeck[dc7e216ee0ac6f70]::typeck
  42:     0x7ffbf851d1e5 - rustc_hir_typeck[dc7e216ee0ac6f70]::typeck
  43:     0x7ffbf85828a1 - rustc_hir_typeck[dc7e216ee0ac6f70]::typeck
  44:     0x7ffbf8585246 - rustc_hir_typeck[dc7e216ee0ac6f70]::typeck
  45:     0x7ffbf851d13a - rustc_hir_typeck[dc7e216ee0ac6f70]::typeck
  46:     0x7ffbf860abbc - rustc_hir_typeck[dc7e216ee0ac6f70]::intrinsicck::check_transmutes
  47:     0x7ffbf84b931b - <hashbrown[e2b63d2d2398afe6]::raw::RawTable<usize>>::reserve_rehash::<indexmap[e311de0fb82bc327]::map::core::get_hash<(rustc_middle[f6c398a2b1747a0e]::ty::predicate::Predicate, rustc_middle[f6c398a2b1747a0e]::traits::ObligationCause), ()>::{closure#0}>
  48:     0x7ffbf84cb660 - rustc_hir_typeck[dc7e216ee0ac6f70]::typeck
  49:     0x7ffbf9129b4b - RINvMs6_NtCshrezU2Ub55M_9hashbrown3rawINtB6_8RawTableTTNtNtNtCslbwbWu2vEFm_12rustc_middle2ty8instance8InstanceNtNtNtBX_3mir4mono14CollectionModeETINtNtNtBX_5query5erase6ErasedAhj20_ENtNtNtCsdNFGO0zp5uH_18rustc_query_system9dep_graph5graph12DepNodeIndexEEE1
  50:     0x7ffbf91bd8a2 - RINvNtNtCsdNFGO0zp5uH_18rustc_query_system5query8plumbing17try_execute_queryINtCs6AhV3Iizo1R_16rustc_query_impl13DynamicConfigINtNtCsbnTbZumv88m_21rustc_data_structures9vec_cache8VecCacheNtNtCsbAfC9rN8LBv_10rustc_span6def_id10LocalDefIdINtNtNtCslbwbWu2vEFm
  51:     0x7ffbf91f3c12 - rustc_query_impl[4cb40144551fb19d]::plumbing::query_key_hash_verify_all
  52:     0x7ffbf86686bd - rustc_hir_analysis[a775e08aa5508cb4]::check_crate
  53:     0x7ffbf835f662 - rustc_interface[5aa0ad72e16f066c]::passes::analysis
  54:     0x7ffbf7d5bf5a - <rustc_lint[9b30ddbe56c6c24d]::builtin::SpecialModuleName as rustc_lint[9b30ddbe56c6c24d]::passes::EarlyLintPass>::check_crate
  55:     0x7ffbf7d62247 - RINvNtNtCsdNFGO0zp5uH_18rustc_query_system5query8plumbing17try_execute_queryINtCs6AhV3Iizo1R_16rustc_query_impl13DynamicConfigINtNtB4_6caches11SingleCacheINtNtNtCslbwbWu2vEFm_12rustc_middle5query5erase6ErasedAhj0_EEKb0_KB3s_KB3s_ENtNtB1f_8plumbing9QueryCtx
  56:     0x7ffbf7e3c513 - rustc_query_impl[4cb40144551fb19d]::profiling_support::alloc_self_profile_query_strings
  57:     0x7ffbf587c26f - std[76a36676f23c96cf]::sys::backtrace::__rust_begin_short_backtrace::<std[76a36676f23c96cf]::thread::lifecycle::spawn_unchecked<ctrlc[107595794414e66d]::set_handler_inner<rustc_driver_impl[240853e38f7eec8f]::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>       
  58:     0x7ffbf58748df - RINvNtNtCsabvxNuRDEW9_3std3sys9backtrace28___rust_begin_short_backtraceNCNCINvNtCs7Mplz9yphjk_15rustc_interface4util26run_in_thread_with_globalsNCINvB1e_31run_in_thread_pool_with_globalsNCINvNtB1g_9interface12run_compileruNCNvCs35NCoJMdRbn_17rustc_driver_i
  59:     0x7ffbf5882bc9 - std[76a36676f23c96cf]::sys::backtrace::__rust_begin_short_backtrace::<std[76a36676f23c96cf]::thread::lifecycle::spawn_unchecked<ctrlc[107595794414e66d]::set_handler_inner<rustc_driver_impl[240853e38f7eec8f]::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>       
  60:     0x7ffbf82ec638 - std::sys::thread::windows::impl$0::new::thread_start
                               at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library\std\src\sys\thread\windows.rs:58
  61:     0x7ffcc20ae8d7 - BaseThreadInitThunk
  62:     0x7ffcc436c40c - 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: rustc 1.94.0 (4a4ef493e 2026-03-02) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type bin -C embed-bitcode=no -C strip=debuginfo

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

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `core::iter::adapters::flatten::Flatten<std::fs::ReadDir>: bevy_ecs::system::IntoSystem<^c_0, ^c_1, ^c_2>`
#1 [typeck] type-checking `game::frame::load_frame_catalog_from_dir`
... and 1 other queries... use `env RUST_BACKTRACE=1` to see the full query stack

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported rustc 1.94.0 Windows panic in deps\ena-0.14.3\src\snapshot_vec.rs:53:17 and the rustc_infer::InferCtxt::rollback_to stack entry. Reproduce the obligation involving Flattenstd::fs::ReadDir and bevy_ecs::system::IntoSystem while type-checking game::frame::load_frame_catalog_from_dir; done means the compiler no longer panics on a minimized case and has regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.