Skip to content

ICE: parallel: internal error: entered unreachable code #142064

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
matthiaskrgr opened this issue Jun 5, 2025 · 3 comments
Open

ICE: parallel: internal error: entered unreachable code #142064

matthiaskrgr opened this issue Jun 5, 2025 · 3 comments
Labels
A-parallel-compiler Area: parallel compiler C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

//@compile-flags: --edition=2024 -Zthreads=2 --crate-type=lib
trait A { fn foo() -> A; }
trait B { fn foo() -> A; }

Meta

rustc --version --verbose:

rustc 1.89.0-nightly (81a964c23 2025-06-05)
binary: rustc
commit-hash: 81a964c23ea4fe9ab52b4449bb166bf280035797
commit-date: 2025-06-05
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5

Error output

<output>
Backtrace

thread 'rustc' panicked at compiler/rustc_middle/src/values.rs:62:13:
internal error: entered unreachable code
stack backtrace:
   0:     0x74db7128a053 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hd7de588f2186284a
   1:     0x74db71a029f7 - core::fmt::write::h59e3d8534099ec1b
   2:     0x74db7127fde3 - std::io::Write::write_fmt::h80858133b280c235
   3:     0x74db71289eb2 - std::sys::backtrace::BacktraceLock::print::h2b3198fe0055c6a7
   4:     0x74db7128daaa - std::panicking::default_hook::{{closure}}::h3471ef65f1dc6f0f
   5:     0x74db7128d62f - std::panicking::default_hook::hbc8f3a4437fcdf7b
   6:     0x74db70384813 - std[223f7f98806d09cd]::panicking::update_hook::<alloc[f3381f2db88c315b]::boxed::Box<rustc_driver_impl[838fc0770cc6b7bf]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x74db7128e323 - std::panicking::rust_panic_with_hook::h46357c3d3d4456ed
   8:     0x74db7128dfe6 - std::panicking::begin_panic_handler::{{closure}}::hb436a4ad216470c6
   9:     0x74db7128a519 - std::sys::backtrace::__rust_end_short_backtrace::h96cb6cab32c629cd
  10:     0x74db7128dcdd - __rustc[fac0ad678b0de183]::rust_begin_unwind
  11:     0x74db6daa2c80 - core::panicking::panic_fmt::hf76a3ba6e5e84a3b
  12:     0x74db6dce768c - core::panicking::panic::h2f87bc8a1836b474
  13:     0x74db7097e7ec - <rustc_type_ir[fa89ab56e5d1a6cd]::binder::Binder<rustc_middle[59e8487f9f7e50ed]::ty::context::TyCtxt, rustc_type_ir[fa89ab56e5d1a6cd]::ty_kind::FnSig<rustc_middle[59e8487f9f7e50ed]::ty::context::TyCtxt>> as rustc_query_system[dc8d05ed1da9c1b3]::values::Value<rustc_middle[59e8487f9f7e50ed]::ty::context::TyCtxt>>::from_cycle_error
  14:     0x74db70d6b035 - <rustc_query_impl[7c164422c209a242]::query_impl::fn_sig::dynamic_query::{closure#3} as core[31a69e6d0c4300f5]::ops::function::FnOnce<(rustc_middle[59e8487f9f7e50ed]::ty::context::TyCtxt, &rustc_query_system[dc8d05ed1da9c1b3]::query::plumbing::CycleError, rustc_span[c41277e90fa2c474]::ErrorGuaranteed)>>::call_once
  15:     0x74db70ccaaee - rustc_query_system[dc8d05ed1da9c1b3]::query::plumbing::mk_cycle::<rustc_query_impl[7c164422c209a242]::DynamicConfig<rustc_query_system[dc8d05ed1da9c1b3]::query::caches::DefIdCache<rustc_middle[59e8487f9f7e50ed]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[7c164422c209a242]::plumbing::QueryCtxt>
  16:     0x74db71c65d79 - rustc_query_system[dc8d05ed1da9c1b3]::query::plumbing::try_execute_query::<rustc_query_impl[7c164422c209a242]::DynamicConfig<rustc_query_system[dc8d05ed1da9c1b3]::query::caches::DefIdCache<rustc_middle[59e8487f9f7e50ed]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[7c164422c209a242]::plumbing::QueryCtxt, false>
  17:     0x74db71c64de4 - rustc_query_impl[7c164422c209a242]::query_impl::fn_sig::get_query_non_incr::__rust_end_short_backtrace
  18:     0x74db722a56a0 - rustc_trait_selection[378cb4a8dab4dce5]::traits::dyn_compatibility::virtual_call_violations_for_method
  19:     0x74db722a198d - rustc_trait_selection[378cb4a8dab4dce5]::traits::dyn_compatibility::dyn_compatibility_violations_for_assoc_item
  20:     0x74db722a162e - <core[31a69e6d0c4300f5]::iter::adapters::flatten::FlatMap<core[31a69e6d0c4300f5]::iter::adapters::map::Map<core[31a69e6d0c4300f5]::iter::adapters::map::Map<core[31a69e6d0c4300f5]::slice::iter::Iter<(core[31a69e6d0c4300f5]::option::Option<rustc_span[c41277e90fa2c474]::symbol::Symbol>, rustc_middle[59e8487f9f7e50ed]::ty::assoc::AssocItem)>, <rustc_data_structures[13281e957cfd357d]::sorted_map::index_map::SortedIndexMultiMap<u32, core[31a69e6d0c4300f5]::option::Option<rustc_span[c41277e90fa2c474]::symbol::Symbol>, rustc_middle[59e8487f9f7e50ed]::ty::assoc::AssocItem>>::iter::{closure#0}>, <rustc_middle[59e8487f9f7e50ed]::ty::assoc::AssocItems>::in_definition_order::{closure#0}>, alloc[f3381f2db88c315b]::vec::Vec<rustc_middle[59e8487f9f7e50ed]::traits::DynCompatibilityViolation>, rustc_trait_selection[378cb4a8dab4dce5]::traits::dyn_compatibility::dyn_compatibility_violations_for_trait::{closure#0}::{closure#0}> as core[31a69e6d0c4300f5]::iter::traits::iterator::Iterator>::next
  21:     0x74db72919839 - <core[31a69e6d0c4300f5]::iter::adapters::GenericShunt<core[31a69e6d0c4300f5]::iter::adapters::map::Map<core[31a69e6d0c4300f5]::iter::adapters::flatten::FlatMap<core[31a69e6d0c4300f5]::iter::sources::from_fn::FromFn<rustc_type_ir[fa89ab56e5d1a6cd]::elaborate::supertrait_def_ids<rustc_middle[59e8487f9f7e50ed]::ty::context::TyCtxt>::{closure#0}>, alloc[f3381f2db88c315b]::vec::Vec<rustc_middle[59e8487f9f7e50ed]::traits::DynCompatibilityViolation>, rustc_trait_selection[378cb4a8dab4dce5]::traits::dyn_compatibility::dyn_compatibility_violations::{closure#0}>, core[31a69e6d0c4300f5]::result::Result<rustc_middle[59e8487f9f7e50ed]::traits::DynCompatibilityViolation, !>::Ok>, core[31a69e6d0c4300f5]::result::Result<core[31a69e6d0c4300f5]::convert::Infallible, !>> as core[31a69e6d0c4300f5]::iter::traits::iterator::Iterator>::next
  22:     0x74db72918a3b - rustc_trait_selection[378cb4a8dab4dce5]::traits::dyn_compatibility::dyn_compatibility_violations
  23:     0x74db7291892e - rustc_query_impl[7c164422c209a242]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7c164422c209a242]::query_impl::dyn_compatibility_violations::dynamic_query::{closure#2}::{closure#0}, rustc_middle[59e8487f9f7e50ed]::query::erase::Erased<[u8; 16usize]>>
  24:     0x74db72918915 - <rustc_query_impl[7c164422c209a242]::query_impl::dyn_compatibility_violations::dynamic_query::{closure#2} as core[31a69e6d0c4300f5]::ops::function::FnOnce<(rustc_middle[59e8487f9f7e50ed]::ty::context::TyCtxt, rustc_span[c41277e90fa2c474]::def_id::DefId)>>::call_once
  25:     0x74db71c5b894 - rustc_query_system[dc8d05ed1da9c1b3]::query::plumbing::try_execute_query::<rustc_query_impl[7c164422c209a242]::DynamicConfig<rustc_query_system[dc8d05ed1da9c1b3]::query::caches::DefIdCache<rustc_middle[59e8487f9f7e50ed]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[7c164422c209a242]::plumbing::QueryCtxt, false>
  26:     0x74db72a911de - rustc_query_impl[7c164422c209a242]::query_impl::dyn_compatibility_violations::get_query_non_incr::__rust_end_short_backtrace
  27:     0x74db72a90fda - rustc_trait_selection[378cb4a8dab4dce5]::traits::dyn_compatibility::is_dyn_compatible
  28:     0x74db72a90f29 - rustc_query_impl[7c164422c209a242]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7c164422c209a242]::query_impl::is_dyn_compatible::dynamic_query::{closure#2}::{closure#0}, rustc_middle[59e8487f9f7e50ed]::query::erase::Erased<[u8; 1usize]>>
  29:     0x74db71ffaa98 - rustc_query_system[dc8d05ed1da9c1b3]::query::plumbing::try_execute_query::<rustc_query_impl[7c164422c209a242]::DynamicConfig<rustc_query_system[dc8d05ed1da9c1b3]::query::caches::DefIdCache<rustc_middle[59e8487f9f7e50ed]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[7c164422c209a242]::plumbing::QueryCtxt, false>
  30:     0x74db72000664 - rustc_query_impl[7c164422c209a242]::query_impl::is_dyn_compatible::get_query_non_incr::__rust_end_short_backtrace
  31:     0x74db7054f256 - <dyn rustc_hir_analysis[882d67637987d85f]::hir_ty_lowering::HirTyLowerer>::maybe_suggest_impl_trait
  32:     0x74db72cfeaa4 - <dyn rustc_hir_analysis[882d67637987d85f]::hir_ty_lowering::HirTyLowerer>::prohibit_or_lint_bare_trait_object_ty
  33:     0x74db723cf45d - <dyn rustc_hir_analysis[882d67637987d85f]::hir_ty_lowering::HirTyLowerer>::lower_ty
  34:     0x74db7224dc08 - <dyn rustc_hir_analysis[882d67637987d85f]::hir_ty_lowering::HirTyLowerer>::lower_fn_ty
  35:     0x74db7224bc3b - rustc_hir_analysis[882d67637987d85f]::collect::fn_sig
  36:     0x74db71c63a6a - rustc_query_impl[7c164422c209a242]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7c164422c209a242]::query_impl::fn_sig::dynamic_query::{closure#2}::{closure#0}, rustc_middle[59e8487f9f7e50ed]::query::erase::Erased<[u8; 24usize]>>
  37:     0x74db71c63639 - <rustc_query_impl[7c164422c209a242]::query_impl::fn_sig::dynamic_query::{closure#2} as core[31a69e6d0c4300f5]::ops::function::FnOnce<(rustc_middle[59e8487f9f7e50ed]::ty::context::TyCtxt, rustc_span[c41277e90fa2c474]::def_id::DefId)>>::call_once
  38:     0x74db71c656cf - rustc_query_system[dc8d05ed1da9c1b3]::query::plumbing::try_execute_query::<rustc_query_impl[7c164422c209a242]::DynamicConfig<rustc_query_system[dc8d05ed1da9c1b3]::query::caches::DefIdCache<rustc_middle[59e8487f9f7e50ed]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[7c164422c209a242]::plumbing::QueryCtxt, false>
  39:     0x74db71c64de4 - rustc_query_impl[7c164422c209a242]::query_impl::fn_sig::get_query_non_incr::__rust_end_short_backtrace
  40:     0x74db72254779 - <rustc_hir_analysis[882d67637987d85f]::collect::CollectItemTypesVisitor as rustc_hir[9fdf819cfa47c32c]::intravisit::Visitor>::visit_trait_item
  41:     0x74db72262905 - rustc_hir_analysis[882d67637987d85f]::check::wfcheck::check_well_formed
  42:     0x74db7225fa17 - rustc_query_impl[7c164422c209a242]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7c164422c209a242]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[59e8487f9f7e50ed]::query::erase::Erased<[u8; 1usize]>>
  43:     0x74db7225f291 - rustc_query_system[dc8d05ed1da9c1b3]::query::plumbing::try_execute_query::<rustc_query_impl[7c164422c209a242]::DynamicConfig<rustc_data_structures[13281e957cfd357d]::vec_cache::VecCache<rustc_span[c41277e90fa2c474]::def_id::LocalDefId, rustc_middle[59e8487f9f7e50ed]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[dc8d05ed1da9c1b3]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[7c164422c209a242]::plumbing::QueryCtxt, false>
  44:     0x74db7225ed82 - rustc_query_impl[7c164422c209a242]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
  45:     0x74db70479a11 - rustc_middle[59e8487f9f7e50ed]::query::plumbing::query_ensure_error_guaranteed::<rustc_data_structures[13281e957cfd357d]::vec_cache::VecCache<rustc_span[c41277e90fa2c474]::def_id::LocalDefId, rustc_middle[59e8487f9f7e50ed]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[dc8d05ed1da9c1b3]::dep_graph::graph::DepNodeIndex>, ()>
  46:     0x74db7048717e - rustc_data_structures[13281e957cfd357d]::sync::parallel::par_slice::par_rec::<&rustc_hir[9fdf819cfa47c32c]::hir::TraitItemId, rustc_data_structures[13281e957cfd357d]::sync::parallel::try_par_for_each_in<&[rustc_hir[9fdf819cfa47c32c]::hir::TraitItemId], rustc_span[c41277e90fa2c474]::ErrorGuaranteed, <rustc_middle[59e8487f9f7e50ed]::hir::ModuleItems>::par_trait_items<rustc_hir_analysis[882d67637987d85f]::check::wfcheck::check_type_wf::{closure#2}>::{closure#0}>::{closure#0}::{closure#0}>
  47:     0x74db704c02f9 - rayon_core[4722162430a43c7]::join::join_context::<rayon_core[4722162430a43c7]::join::join::call<(), rustc_data_structures[13281e957cfd357d]::sync::parallel::par_slice::par_rec<&rustc_hir[9fdf819cfa47c32c]::hir::TraitItemId, rustc_data_structures[13281e957cfd357d]::sync::parallel::try_par_for_each_in<&[rustc_hir[9fdf819cfa47c32c]::hir::TraitItemId], rustc_span[c41277e90fa2c474]::ErrorGuaranteed, <rustc_middle[59e8487f9f7e50ed]::hir::ModuleItems>::par_trait_items<rustc_hir_analysis[882d67637987d85f]::check::wfcheck::check_type_wf::{closure#2}>::{closure#0}>::{closure#0}::{closure#0}>::{closure#1}>::{closure#0}, rayon_core[4722162430a43c7]::join::join::call<(), rustc_data_structures[13281e957cfd357d]::sync::parallel::par_slice::par_rec<&rustc_hir[9fdf819cfa47c32c]::hir::TraitItemId, rustc_data_structures[13281e957cfd357d]::sync::parallel::try_par_for_each_in<&[rustc_hir[9fdf819cfa47c32c]::hir::TraitItemId], rustc_span[c41277e90fa2c474]::ErrorGuaranteed, <rustc_middle[59e8487f9f7e50ed]::hir::ModuleItems>::par_trait_items<rustc_hir_analysis[882d67637987d85f]::check::wfcheck::check_type_wf::{closure#2}>::{closure#0}>::{closure#0}::{closure#0}>::{closure#2}>::{closure#0}, (), ()>::{closure#0}
  48:     0x74db70487248 - rustc_data_structures[13281e957cfd357d]::sync::parallel::par_slice::par_rec::<&rustc_hir[9fdf819cfa47c32c]::hir::TraitItemId, rustc_data_structures[13281e957cfd357d]::sync::parallel::try_par_for_each_in<&[rustc_hir[9fdf819cfa47c32c]::hir::TraitItemId], rustc_span[c41277e90fa2c474]::ErrorGuaranteed, <rustc_middle[59e8487f9f7e50ed]::hir::ModuleItems>::par_trait_items<rustc_hir_analysis[882d67637987d85f]::check::wfcheck::check_type_wf::{closure#2}>::{closure#0}>::{closure#0}::{closure#0}>
  49:     0x74db7225c74a - rustc_hir_analysis[882d67637987d85f]::check::wfcheck::check_type_wf
  50:     0x74db7225bcb9 - rustc_query_impl[7c164422c209a242]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7c164422c209a242]::query_impl::check_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[59e8487f9f7e50ed]::query::erase::Erased<[u8; 1usize]>>
  51:     0x74db72a3e388 - rustc_query_system[dc8d05ed1da9c1b3]::query::plumbing::try_execute_query::<rustc_query_impl[7c164422c209a242]::DynamicConfig<rustc_query_system[dc8d05ed1da9c1b3]::query::caches::SingleCache<rustc_middle[59e8487f9f7e50ed]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[7c164422c209a242]::plumbing::QueryCtxt, false>
  52:     0x74db72a3e182 - rustc_query_impl[7c164422c209a242]::query_impl::check_type_wf::get_query_non_incr::__rust_end_short_backtrace
  53:     0x74db71d5ef69 - rustc_hir_analysis[882d67637987d85f]::check_crate
  54:     0x74db71d538e8 - rustc_interface[d85128a34ad4eaa4]::passes::analysis
  55:     0x74db71d534f3 - rustc_query_impl[7c164422c209a242]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7c164422c209a242]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[59e8487f9f7e50ed]::query::erase::Erased<[u8; 0usize]>>
  56:     0x74db72a3828e - rustc_query_system[dc8d05ed1da9c1b3]::query::plumbing::try_execute_query::<rustc_query_impl[7c164422c209a242]::DynamicConfig<rustc_query_system[dc8d05ed1da9c1b3]::query::caches::SingleCache<rustc_middle[59e8487f9f7e50ed]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[7c164422c209a242]::plumbing::QueryCtxt, false>
  57:     0x74db72a37e76 - rustc_query_impl[7c164422c209a242]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  58:     0x74db72be2c3f - rustc_interface[d85128a34ad4eaa4]::passes::create_and_enter_global_ctxt::<core[31a69e6d0c4300f5]::option::Option<rustc_interface[d85128a34ad4eaa4]::queries::Linker>, rustc_driver_impl[838fc0770cc6b7bf]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  59:     0x74db72bd4330 - rustc_interface[d85128a34ad4eaa4]::interface::run_compiler::<(), rustc_driver_impl[838fc0770cc6b7bf]::run_compiler::{closure#0}>::{closure#1}
  60:     0x74db703996b4 - <rayon_core[4722162430a43c7]::job::StackJob<rayon_core[4722162430a43c7]::latch::LatchRef<rayon_core[4722162430a43c7]::latch::LockLatch>, <rayon_core[4722162430a43c7]::registry::Registry>::in_worker_cold<<rayon_core[4722162430a43c7]::thread_pool::ThreadPool>::install<rustc_interface[d85128a34ad4eaa4]::util::run_in_thread_pool_with_globals<rustc_interface[d85128a34ad4eaa4]::interface::run_compiler<(), rustc_driver_impl[838fc0770cc6b7bf]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#5}::{closure#0}::{closure#1}::{closure#0}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()> as rayon_core[4722162430a43c7]::job::Job>::execute
  61:     0x74db6fea065e - <rayon_core[4722162430a43c7]::registry::WorkerThread>::wait_until_cold
  62:     0x74db6fe9dfe1 - <rayon_core[4722162430a43c7]::registry::ThreadBuilder>::run
  63:     0x74db7037ad8d - std[223f7f98806d09cd]::sys::backtrace::__rust_begin_short_backtrace::<<rayon_core[4722162430a43c7]::ThreadPoolBuilder>::build_scoped<rustc_interface[d85128a34ad4eaa4]::util::run_in_thread_pool_with_globals<rustc_interface[d85128a34ad4eaa4]::interface::run_compiler<(), rustc_driver_impl[838fc0770cc6b7bf]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#5}::{closure#0}::{closure#0}, rustc_interface[d85128a34ad4eaa4]::util::run_in_thread_pool_with_globals<rustc_interface[d85128a34ad4eaa4]::interface::run_compiler<(), rustc_driver_impl[838fc0770cc6b7bf]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#5}::{closure#0}::{closure#1}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
  64:     0x74db70389d32 - <<std[223f7f98806d09cd]::thread::Builder>::spawn_unchecked_<<rayon_core[4722162430a43c7]::ThreadPoolBuilder>::build_scoped<rustc_interface[d85128a34ad4eaa4]::util::run_in_thread_pool_with_globals<rustc_interface[d85128a34ad4eaa4]::interface::run_compiler<(), rustc_driver_impl[838fc0770cc6b7bf]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#5}::{closure#0}::{closure#0}, rustc_interface[d85128a34ad4eaa4]::util::run_in_thread_pool_with_globals<rustc_interface[d85128a34ad4eaa4]::interface::run_compiler<(), rustc_driver_impl[838fc0770cc6b7bf]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#5}::{closure#0}::{closure#1}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>::{closure#1} as core[31a69e6d0c4300f5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  65:     0x74db72c07bfd - std::sys::pal::unix::thread::Thread::new::thread_start::h9c37dacde5045541
  66:     0x74db6c6a57eb - <unknown>
  67:     0x74db6c72918c - <unknown>
  68:                0x0 - <unknown>

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

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

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/tmp/im/rustc-ice-2025-06-05T06_46_38-2943799.txt` to your bug report

note: compiler flags: -Z threads=2 --crate-type lib

query stack during panic:
#0 [dyn_compatibility_violations] determining dyn-compatibility of trait `A`
#1 [is_dyn_compatible] checking if trait `A` is dyn-compatible
... and 4 other queries... use `env RUST_BACKTRACE=1` to see the full query stack
note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors

error: internal compiler error[E0391]: cycle detected when checking if trait `A` is dyn-compatible
 --> b.rs:1:1
  |
1 | trait A { fn foo() -> A; }
  | ^^^^^^^
  |
note: ...which requires determining dyn-compatibility of trait `A`...
 --> b.rs:1:1
  |
1 | trait A { fn foo() -> A; }
  | ^^^^^^^
note: ...which requires computing function signature of `A::foo`...
 --> b.rs:1:11
  |
1 | trait A { fn foo() -> A; }
  |           ^^^^^^^^^^^^^^
  = note: ...which again requires checking if trait `A` is dyn-compatible, completing the cycle
note: cycle used when computing function signature of `B::foo`
 --> b.rs:2:11
  |
2 | trait B { fn foo() -> A; }
  |           ^^^^^^^^^^^^^^
  = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
note: delayed at compiler/rustc_query_system/src/query/job.rs:602:16 - disabled backtrace
 --> b.rs:1:1
  |
1 | trait A { fn foo() -> A; }
  | ^^^^^^^

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 `/tmp/im/rustc-ice-2025-06-05T06_46_38-2943799.txt` to your bug report

note: compiler flags: -Z threads=2 --crate-type lib

query stack during panic:
end of query stack

@matthiaskrgr matthiaskrgr added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Jun 5, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 5, 2025
@matthiaskrgr matthiaskrgr added the A-parallel-compiler Area: parallel compiler label Jun 5, 2025
@matthiaskrgr
Copy link
Member Author

Hmm, when I name the file "crash.rs" it does not repro, but when I name it "b.rs" it does? 😆

@matthiaskrgr
Copy link
Member Author

matthiaskrgr commented Jun 5, 2025

Seems this was introduced somewhere between
rustc 1.89.0-nightly (4b27a04cc 2025-06-04)
and
rustc 1.89.0-nightly (81a964c23 2025-06-05)

maybe #141968 ?

@cushionbadak
Copy link

Hmm, when I name the file "crash.rs" it does not repro, but when I name it "b.rs" it does? 😆

In my environment,

  • rustc crash.rs --edition=2024 -Zthreads=2 --crate-type=lib causes ICE, but
  • rustc b.rs --edition=2024 -Zthreads=2 --crate-type=lib does not.
rustc 1.89.0-nightly (ccf3198de 2025-06-05)
binary: rustc
commit-hash: ccf3198de316b488ee17441935182e9d5292b4d3
commit-date: 2025-06-05
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parallel-compiler Area: parallel compiler C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants