rust-lang / rust-lang/rust

panic at compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:18:54

Open
#149,055 7 comments 1 reaction 1 assignee View on GitHub

@khaledS20 is already working on this.

Since Nov 18, 2025.

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

Description

Sorry I can't reproduce the issue and unfortunately the code that triggered it is very complex and private.

Here's the log:

thread 'rustc' (10643760) panicked at compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:18:54:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:        0x10ecbbe30 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h616cb314f2809ae5
   1:        0x10c0f391c - core::fmt::write::h18ff235c5756333a
   2:        0x10ec75938 - std::io::Write::write_fmt::h08b80747d0efe8cf
   3:        0x10ec871d4 - std::sys::backtrace::BacktraceLock::print::h96f00828e06745e0
   4:        0x10ec8d7f8 - std::panicking::default_hook::{{closure}}::h662f695cb162c645
   5:        0x10ec8d498 - std::panicking::default_hook::hdc5171bc2654f38e
   6:        0x10cc9490c - std[dcdb8a79b2b43be4]::panicking::update_hook::<alloc[e924fcec0ad23c69]::boxed::Box<rustc_driver_impl[93380e43239406b8]::install_ice_hook::{closure#1}>>::{closure#0}
   7:        0x10ec8dd20 - std::panicking::panic_with_hook::hc216de099a2fe04e
   8:        0x10ec8d9a8 - std::panicking::panic_handler::{{closure}}::hc0a7f90b1247e042
   9:        0x10ec872ec - std::sys::backtrace::__rust_end_short_backtrace::he22d41b92463e575
  10:        0x10ec6ba20 - __rustc[de0091b922c53d7e]::rust_begin_unwind
  11:        0x1119f9dcc - core::panicking::panic_fmt::h9ec18d20141b7425
  12:        0x1119f9dac - core::panicking::panic::h7f4638f81e80c84c
  13:        0x1119f94f4 - core::option::unwrap_failed::h9b6dee36f255b627
  14:        0x10d8939bc - <rustc_metadata[ba7733ec3e7039d1]::rmeta::decoder::cstore_impl::provide_cstore_hooks::{closure#0} as core[137ed0b9e3cbed0c]::ops::function::FnOnce<(rustc_middle[bdd67e833c77e89f]::ty::context::TyCtxt, rustc_span[90b4742fca18941a]::def_id::DefPathHash, rustc_span[90b4742fca18941a]::def_id::StableCrateId)>>::call_once
  15:        0x10d952328 - <rustc_middle[bdd67e833c77e89f]::ty::context::TyCtxt>::def_path_hash_to_def_id
  16:        0x10e157724 - rustc_query_impl[a11e058736f60389]::plumbing::force_from_dep_node::<rustc_query_impl[a11e058736f60389]::DynamicConfig<rustc_query_system[109cd13dd21d7ab8]::query::caches::DefIdCache<rustc_middle[bdd67e833c77e89f]::query::erase::Erased<[u8; 8usize]>>, false, false, false>>
  17:        0x10e407d1c - <rustc_query_impl[a11e058736f60389]::plumbing::query_callback<rustc_query_impl[a11e058736f60389]::query_impl::type_of::QueryType>::{closure#0} as core[137ed0b9e3cbed0c]::ops::function::FnOnce<(rustc_middle[bdd67e833c77e89f]::ty::context::TyCtxt, rustc_query_system[109cd13dd21d7ab8]::dep_graph::dep_node::DepNode, rustc_query_system[109cd13dd21d7ab8]::dep_graph::serialized::SerializedDepNodeIndex)>>::call_once
  18:        0x10e11ecd4 - <rustc_query_system[109cd13dd21d7ab8]::dep_graph::graph::DepGraphData<rustc_middle[bdd67e833c77e89f]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[a11e058736f60389]::plumbing::QueryCtxt>
  19:        0x10e11ec80 - <rustc_query_system[109cd13dd21d7ab8]::dep_graph::graph::DepGraphData<rustc_middle[bdd67e833c77e89f]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[a11e058736f60389]::plumbing::QueryCtxt>
  20:        0x10e11ec80 - <rustc_query_system[109cd13dd21d7ab8]::dep_graph::graph::DepGraphData<rustc_middle[bdd67e833c77e89f]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[a11e058736f60389]::plumbing::QueryCtxt>
  21:        0x10e11eab0 - <rustc_query_system[109cd13dd21d7ab8]::dep_graph::graph::DepGraphData<rustc_middle[bdd67e833c77e89f]::dep_graph::DepsType>>::try_mark_green::<rustc_query_impl[a11e058736f60389]::plumbing::QueryCtxt>
  22:        0x10e1a0218 - rustc_query_system[109cd13dd21d7ab8]::query::plumbing::try_execute_query::<rustc_query_impl[a11e058736f60389]::DynamicConfig<rustc_query_system[109cd13dd21d7ab8]::query::caches::DefaultCache<rustc_type_ir[71611c7a4cb1232f]::canonical::CanonicalQueryInput<rustc_middle[bdd67e833c77e89f]::ty::context::TyCtxt, rustc_middle[bdd67e833c77e89f]::ty::ParamEnvAnd<rustc_middle[bdd67e833c77e89f]::ty::predicate::Predicate>>, rustc_middle[bdd67e833c77e89f]::query::erase::Erased<[u8; 2usize]>>, false, false, false>, rustc_query_impl[a11e058736f60389]::plumbing::QueryCtxt, true>
  23:        0x10e2deeb4 - rustc_query_impl[a11e058736f60389]::query_impl::evaluate_obligation::get_query_incr::__rust_end_short_backtrace
  24:        0x10ea1539c - <rustc_infer[e2bf0338b980650d]::infer::InferCtxt as rustc_trait_selection[373224338dfe82c4]::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation
  25:        0x10ea1574c - <rustc_infer[e2bf0338b980650d]::infer::InferCtxt as rustc_trait_selection[373224338dfe82c4]::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation_no_overflow
  26:        0x10e992cc0 - <rustc_trait_selection[373224338dfe82c4]::traits::fulfill::FulfillProcessor>::process_trait_obligation
  27:        0x10ea55b88 - <rustc_trait_selection[373224338dfe82c4]::traits::fulfill::FulfillProcessor as rustc_data_structures[bcfe4d3f2eb77d37]::obligation_forest::ObligationProcessor>::process_obligation
  28:        0x10e7fda04 - <rustc_data_structures[bcfe4d3f2eb77d37]::obligation_forest::ObligationForest<rustc_trait_selection[373224338dfe82c4]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[373224338dfe82c4]::traits::fulfill::FulfillProcessor>
  29:        0x10ea22ad4 - <rustc_trait_selection[373224338dfe82c4]::traits::fulfill::FulfillmentContext<rustc_infer[e2bf0338b980650d]::traits::engine::ScrubbedTraitError> as rustc_infer[e2bf0338b980650d]::traits::engine::TraitEngine<rustc_infer[e2bf0338b980650d]::traits::engine::ScrubbedTraitError>>::select_where_possible
  30:        0x10ea9be10 - <rustc_trait_selection[373224338dfe82c4]::traits::fulfill::FulfillmentContext<rustc_infer[e2bf0338b980650d]::traits::engine::ScrubbedTraitError> as rustc_infer[e2bf0338b980650d]::traits::engine::TraitEngine<rustc_infer[e2bf0338b980650d]::traits::engine::ScrubbedTraitError>>::select_all_or_error
  31:        0x10eab4744 - <rustc_trait_selection[373224338dfe82c4]::traits::engine::ObligationCtxt>::make_canonicalized_query_response::<()>
  32:        0x10eb25440 - rustc_traits[63bb3c1e6d9ac802]::type_op::type_op_prove_predicate
  33:        0x10e167478 - rustc_query_impl[a11e058736f60389]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a11e058736f60389]::query_impl::type_op_prove_predicate::dynamic_query::{closure#2}::{closure#0}, rustc_middle[bdd67e833c77e89f]::query::erase::Erased<[u8; 8usize]>>
  34:        0x10e43bb5c - <rustc_query_impl[a11e058736f60389]::query_impl::type_op_prove_predicate::dynamic_query::{closure#2} as core[137ed0b9e3cbed0c]::ops::function::FnOnce<(rustc_middle[bdd67e833c77e89f]::ty::context::TyCtxt, rustc_type_ir[71611c7a4cb1232f]::canonical::CanonicalQueryInput<rustc_middle[bdd67e833c77e89f]::ty::context::TyCtxt, rustc_middle[bdd67e833c77e89f]::ty::ParamEnvAnd<rustc_middle[bdd67e833c77e89f]::traits::query::type_op::ProvePredicate>>)>>::call_once
  35:        0x10e1a2a70 - rustc_query_system[109cd13dd21d7ab8]::query::plumbing::try_execute_query::<rustc_query_impl[a11e058736f60389]::DynamicConfig<rustc_query_system[109cd13dd21d7ab8]::query::caches::DefaultCache<rustc_type_ir[71611c7a4cb1232f]::canonical::CanonicalQueryInput<rustc_middle[bdd67e833c77e89f]::ty::context::TyCtxt, rustc_middle[bdd67e833c77e89f]::ty::ParamEnvAnd<rustc_middle[bdd67e833c77e89f]::traits::query::type_op::ProvePredicate>>, rustc_middle[bdd67e833c77e89f]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[a11e058736f60389]::plumbing::QueryCtxt, true>
  36:        0x10e2ec020 - rustc_query_impl[a11e058736f60389]::query_impl::type_op_prove_predicate::get_query_incr::__rust_end_short_backtrace
  37:        0x10ea16170 - <rustc_middle[bdd67e833c77e89f]::traits::query::type_op::ProvePredicate as rustc_trait_selection[373224338dfe82c4]::traits::query::type_op::QueryTypeOp>::perform_query
  38:        0x10c54ee78 - <rustc_borrowck[fa28a1bac3fe91dd]::type_check::TypeChecker>::fully_perform_op::<(), rustc_middle[bdd67e833c77e89f]::ty::ParamEnvAnd<rustc_middle[bdd67e833c77e89f]::traits::query::type_op::ProvePredicate>>
  39:        0x10c6ac248 - <rustc_borrowck[fa28a1bac3fe91dd]::type_check::TypeChecker>::normalize_and_prove_instantiated_predicates
  40:        0x10c798cc4 - <rustc_borrowck[fa28a1bac3fe91dd]::type_check::TypeChecker as rustc_middle[bdd67e833c77e89f]::mir::visit::Visitor>::visit_const_operand
  41:        0x10c793a08 - <rustc_borrowck[fa28a1bac3fe91dd]::type_check::TypeChecker as rustc_middle[bdd67e833c77e89f]::mir::visit::Visitor>::visit_operand
  42:        0x10c795678 - <rustc_borrowck[fa28a1bac3fe91dd]::type_check::TypeChecker as rustc_middle[bdd67e833c77e89f]::mir::visit::Visitor>::visit_terminator
  43:        0x10c78ec68 - <rustc_borrowck[fa28a1bac3fe91dd]::type_check::TypeChecker as rustc_middle[bdd67e833c77e89f]::mir::visit::Visitor>::visit_body
  44:        0x10c72c42c - rustc_borrowck[fa28a1bac3fe91dd]::type_check::type_check
  45:        0x10c69dafc - <rustc_borrowck[fa28a1bac3fe91dd]::root_cx::BorrowCheckRootCtxt>::do_mir_borrowck
  46:        0x10c687fb8 - rustc_borrowck[fa28a1bac3fe91dd]::mir_borrowck
  47:        0x10e163014 - rustc_query_impl[a11e058736f60389]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a11e058736f60389]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[bdd67e833c77e89f]::query::erase::Erased<[u8; 8usize]>>
  48:        0x10e20667c - rustc_query_system[109cd13dd21d7ab8]::query::plumbing::try_execute_query::<rustc_query_impl[a11e058736f60389]::DynamicConfig<rustc_data_structures[bcfe4d3f2eb77d37]::vec_cache::VecCache<rustc_span[90b4742fca18941a]::def_id::LocalDefId, rustc_middle[bdd67e833c77e89f]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[109cd13dd21d7ab8]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[a11e058736f60389]::plumbing::QueryCtxt, true>
  49:        0x10e2c9eb0 - rustc_query_impl[a11e058736f60389]::query_impl::mir_borrowck::get_query_incr::__rust_end_short_backtrace
  50:        0x10d554468 - <rustc_middle[bdd67e833c77e89f]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface[458eaf07f27e250a]::passes::run_required_analyses::{closure#1}::{closure#0}>::{closure#0}
  51:        0x10d597940 - rustc_interface[458eaf07f27e250a]::passes::run_required_analyses
  52:        0x10d59a338 - rustc_interface[458eaf07f27e250a]::passes::analysis
  53:        0x10e168b00 - rustc_query_impl[a11e058736f60389]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a11e058736f60389]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[bdd67e833c77e89f]::query::erase::Erased<[u8; 0usize]>>
  54:        0x10e184dac - rustc_query_system[109cd13dd21d7ab8]::query::plumbing::try_execute_query::<rustc_query_impl[a11e058736f60389]::DynamicConfig<rustc_query_system[109cd13dd21d7ab8]::query::caches::SingleCache<rustc_middle[bdd67e833c77e89f]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[a11e058736f60389]::plumbing::QueryCtxt, true>
  55:        0x10e2fafd0 - rustc_query_impl[a11e058736f60389]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  56:        0x10cc83cac - rustc_interface[458eaf07f27e250a]::passes::create_and_enter_global_ctxt::<core[137ed0b9e3cbed0c]::option::Option<rustc_interface[458eaf07f27e250a]::queries::Linker>, rustc_driver_impl[93380e43239406b8]::run_compiler::{closure#0}::{closure#2}>
  57:        0x10cc92f14 - rustc_interface[458eaf07f27e250a]::interface::run_compiler::<(), rustc_driver_impl[93380e43239406b8]::run_compiler::{closure#0}>::{closure#1}
  58:        0x10cc874e4 - std[dcdb8a79b2b43be4]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[458eaf07f27e250a]::util::run_in_thread_with_globals<rustc_interface[458eaf07f27e250a]::util::run_in_thread_pool_with_globals<rustc_interface[458eaf07f27e250a]::interface::run_compiler<(), rustc_driver_impl[93380e43239406b8]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  59:        0x10cc99200 - <<std[dcdb8a79b2b43be4]::thread::Builder>::spawn_unchecked_<rustc_interface[458eaf07f27e250a]::util::run_in_thread_with_globals<rustc_interface[458eaf07f27e250a]::util::run_in_thread_pool_with_globals<rustc_interface[458eaf07f27e250a]::interface::run_compiler<(), rustc_driver_impl[93380e43239406b8]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[137ed0b9e3cbed0c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  60:        0x10ec83cb8 - std::sys::thread::unix::Thread::new::thread_start::h6ddd5a264790bcab
  61:        0x192ee1c08 - __pthread_cond_wait

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.91.0 (f8297e351 2025-10-28) running on aarch64-apple-darwin

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED]

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

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `{coroutine witness@[REDACTED]}: core::marker::Send`
#1 [type_op_prove_predicate] evaluating `type_op_prove_predicate` `ProvePredicate { predicate: Binder { value: TraitPredicate(<{async block@h[REDACTRED]} as core::marker::Send>, polarity:Positive), bound_vars: [] } }`
... and 2 other queries... use `env RUST_BACKTRACE=1` to see the full query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 TraitSelect(9f901526fb9013bf-461a829e600423da)
#1 TraitSelect(3286289bb5d1551c-83decdd5e63c3118)
#2 evaluate_obligation(bfe598cc4511f4dd-cb21e456e20d2c82)
end of try_mark_green dep node 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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.