rust-lang / rust-lang/rust

Compiler Error when working with Complex Types and Traits (sometimes)

Open
#141,625 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

I found this compiler bug which keeps coming back every so often. When I delete my build directory are re-build, it seems to fix itself.
There is no code I could provide to give a repeatable error however the gist of what the code that seems to sometimes be breaking the compiler is doing is just passing data between structs where all the structs implement a trait.

The specific way this is being done is such that at the end of it all, I have a very nice type to work with that looks like the following:

let mut task_dispatch: TaskDispatch<'_, WritePngFilterByte<DedicatedThread<Compressor<Zlib, DedicatedThread<PngWriter<BufWriter<File>>>>>>>;

A complete description of the data pipeline in one type signature, which is rust at its best in my opinion.
Though I suppose this abuse of the type system might be making some internal stuff upset.
I'm going to be backing up all the files in my working directory so maybe this can be re-created.

Again, having run into this error before (I think) the fix is to just delete all the files in the build directory and go from there.

If any more information is needed from me, I would be happy to help.

Meta

rustc --version --verbose:

rustc 1.86.0 (05f9846f8 2025-03-31)
binary: rustc
commit-hash: 05f9846f893b09a1be1fc8560e33fc3c815cfecb
commit-date: 2025-03-31
host: x86_64-unknown-linux-gnu
release: 1.86.0
LLVM version: 19.1.7
Error output
thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:23:54:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: core::option::unwrap_failed
   4: <rustc_query_system::dep_graph::dep_node::DepNode as rustc_middle::dep_graph::dep_node::DepNodeExt>::extract_def_id
   5: rustc_query_impl::plumbing::force_from_dep_node::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>>
   6: <rustc_query_impl::plumbing::query_callback<rustc_query_impl::query_impl::type_of::QueryType>::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_query_system::dep_graph::dep_node::DepNode)>>::call_once
   7: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
   8: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
   9: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  10: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  11: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  12: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  13: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  14: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  15: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_type_ir::canonical::CanonicalQueryInput<rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<rustc_middle::ty::predicate::Predicate>>, rustc_middle::query::erase::Erased<[u8; 2]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
  16: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
  17: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
  18: rustc_traits::normalize_projection_ty::normalize_canonicalized_projection_ty
      [... omitted 2 frames ...]
  19: <rustc_trait_selection::traits::query::normalize::QueryNormalizer as rustc_type_ir::fold::FallibleTypeFolder<rustc_middle::ty::context::TyCtxt>>::try_fold_ty
  20: <&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_trait_selection::traits::query::normalize::QueryNormalizer>
  21: <rustc_middle::ty::Ty as rustc_type_ir::fold::TypeSuperFoldable<rustc_middle::ty::context::TyCtxt>>::try_super_fold_with::<rustc_trait_selection::traits::query::normalize::QueryNormalizer>
  22: <rustc_trait_selection::traits::query::normalize::QueryNormalizer as rustc_type_ir::fold::FallibleTypeFolder<rustc_middle::ty::context::TyCtxt>>::try_fold_ty
  23: <rustc_traits::normalize_erasing_regions::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::ty::PseudoCanonicalInput<rustc_middle::ty::generic_args::GenericArg>)>>::call_once
      [... omitted 1 frame ...]
  24: <rustc_middle::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_ty
  25: rustc_monomorphize::mono_checks::check_mono_item
      [... omitted 1 frame ...]
  26: rustc_monomorphize::collector::items_of_instance
      [... omitted 1 frame ...]
  27: rustc_monomorphize::collector::collect_items_rec::{closure#0}
  28: rustc_monomorphize::collector::collect_items_rec
  29: rustc_monomorphize::collector::collect_items_rec
  30: rustc_monomorphize::collector::collect_items_rec
  31: rustc_monomorphize::collector::collect_items_rec
  32: rustc_monomorphize::collector::collect_items_rec
  33: rustc_monomorphize::collector::collect_items_rec
  34: rustc_monomorphize::collector::collect_items_rec
  35: rustc_monomorphize::collector::collect_items_rec
  36: rustc_monomorphize::collector::collect_items_rec
  37: rustc_monomorphize::collector::collect_items_rec
  38: rustc_monomorphize::collector::collect_items_rec
  39: rustc_monomorphize::collector::collect_items_rec
  40: rustc_monomorphize::collector::collect_items_rec
  41: rustc_monomorphize::collector::collect_items_rec
  42: rustc_monomorphize::collector::collect_items_rec
  43: rustc_monomorphize::collector::collect_crate_mono_items
  44: rustc_monomorphize::partitioning::collect_and_partition_mono_items
      [... omitted 2 frames ...]
  45: rustc_codegen_ssa::base::codegen_crate::<rustc_codegen_llvm::LlvmCodegenBackend>
  46: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  47: <rustc_interface::queries::Linker>::codegen_and_build_linker
  48: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  49: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
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: rustc 1.86.0 (05f9846f8 2025-03-31) running on x86_64-unknown-linux-gnu

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:
#0 [evaluate_obligation] evaluating trait selection obligation `libkyros::dpo::dedicated_thread::DedicatedThread<libkyros::dpo::png_writer::PngWriter<std::io::buffered::bufwriter::BufWriter<std::fs::File>>>: core::marker::Send`
#1 [normalize_canonicalized_projection_ty] normalizing `<libkyros::dpo::compression::Compressor<libkyros::zlib::Zlib, libkyros::dpo::dedicated_thread::DedicatedThread<libkyros::dpo::png_writer::PngWriter<std::io::buffered::bufwriter::BufWriter<std::fs::File>>>> as libkyros::data_pipeline::PipelineObjectToAsyncTask>::{synthetic#0}`
#2 [try_normalize_generic_arg_after_erasing_regions] normalizing `tokio::task::spawn::spawn<<libkyros::dpo::compression::Compressor<libkyros::zlib::Zlib, libkyros::dpo::dedicated_thread::DedicatedThread<libkyros::dpo::png_writer::PngWriter<std::io::buffered::bufwriter::BufWriter<std::fs::File>>>> as libkyros::data_pipeline::PipelineObjectToAsyncTask>::{synthetic#0}>`
#3 [check_mono_item] monomorphization-time checking
#4 [items_of_instance] collecting items used by `libkyros::dpo::dedicated_thread::DedicatedThread::<libkyros::dpo::compression::Compressor<libkyros::zlib::Zlib, libkyros::dpo::dedicated_thread::DedicatedThread<libkyros::dpo::png_writer::PngWriter<std::io::buffered::bufwriter::BufWriter<std::fs::File>>>>>::new`
#5 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 TraitSelect(fc6705b5be260dc0-3f21805f2291d699)
#1 TraitSelect(317da9c3517e382f-1d0f9c385018b1af)
#2 TraitSelect(7a2525fd20b7b6e3-b02ef62a8a1b0a6d)
#3 TraitSelect(1928d509b13af827-52b6ae974b1b9423)
#4 TraitSelect(b524bb0a45ddf191-9b0e13a36e93d1ab)
#5 TraitSelect(55e9d91652dc3a9f-33b3aa729f245cab)
#6 TraitSelect(390aa7e7d1628e09-48abca5bbb8624ed)
#7 evaluate_obligation(fd72c031bb1e930c-a004fde036ad1393)
end of try_mark_green dep node stack
error: could not compile `kyros` (bin "kyros")

Caused by:
  process didn't exit successfully: `/home/some1and2/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc --crate-name kyros --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=157 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=1762e0f876e00a83 -C extra-filename=-49605bd643b1d14a --out-dir /home/some1and2/Documents/kyros-core/target/debug/deps -C incremental=/home/some1and2/Documents/kyros-core/target/debug/incremental -L dependency=/home/some1and2/Documents/kyros-core/target/debug/deps --extern ahash=/home/some1and2/Documents/kyros-core/target/debug/deps/libahash-0d6b1a35c8df6a1f.rlib --extern base64=/home/some1and2/Documents/kyros-core/target/debug/deps/libbase64-013c86e4129b6a32.rlib --extern bincode=/home/some1and2/Documents/kyros-core/target/debug/deps/libbincode-fbc02f37c0bcaf00.rlib --extern bytes=/home/some1and2/Documents/kyros-core/target/debug/deps/libbytes-c74caac21b6e312e.rlib --extern chrono=/home/some1and2/Documents/kyros-core/target/debug/deps/libchrono-4e594e64b147aaed.rlib --extern clap=/home/some1and2/Documents/kyros-core/target/debug/deps/libclap-70772f1ec5b3e52c.rlib --extern core_affinity=/home/some1and2/Documents/kyros-core/target/debug/deps/libcore_affinity-8357a1a682063768.rlib --extern cpu_time=/home/some1and2/Documents/kyros-core/target/debug/deps/libcpu_time-04a7ab8b7280f74d.rlib --extern csscolorparser=/home/some1and2/Documents/kyros-core/target/debug/deps/libcsscolorparser-cf8a30da43a59310.rlib --extern enum_delegate=/home/some1and2/Documents/kyros-core/target/debug/deps/libenum_delegate-ee4f60ae02f23951.so --extern flate2=/home/some1and2/Documents/kyros-core/target/debug/deps/libflate2-e942ce32237b6588.rlib --extern flume=/home/some1and2/Documents/kyros-core/target/debug/deps/libflume-faec93103db59854.rlib --extern futures=/home/some1and2/Documents/kyros-core/target/debug/deps/libfutures-dead497e7e8d4ea2.rlib --extern gzp=/home/some1and2/Documents/kyros-core/target/debug/deps/libgzp-aadcdc0dbd62f35a.rlib --extern hsv=/home/some1and2/Documents/kyros-core/target/debug/deps/libhsv-226c79f0d43f580e.rlib --extern image=/home/some1and2/Documents/kyros-core/target/debug/deps/libimage-70b1af5976efa45f.rlib --extern indicatif=/home/some1and2/Documents/kyros-core/target/debug/deps/libindicatif-3628dcba141a3bc3.rlib --extern libkyros=/home/some1and2/Documents/kyros-core/target/debug/deps/liblibkyros-1f1ed999054d11c5.rlib --extern lazy_static=/home/some1and2/Documents/kyros-core/target/debug/deps/liblazy_static-56fe2bd04ed1ed5a.rlib --extern libz_ng_sys=/home/some1and2/Documents/kyros-core/target/debug/deps/liblibz_ng_sys-acfa9f5d004641e3.rlib --extern log=/home/some1and2/Documents/kyros-core/target/debug/deps/liblog-ff97d2b12ce05993.rlib --extern minijinja=/home/some1and2/Documents/kyros-core/target/debug/deps/libminijinja-5de562a4f2edd7fc.rlib --extern ntest=/home/some1and2/Documents/kyros-core/target/debug/deps/libntest-78137898473299f2.rlib --extern png=/home/some1and2/Documents/kyros-core/target/debug/deps/libpng-8b52c0c299f5d216.rlib --extern serde=/home/some1and2/Documents/kyros-core/target/debug/deps/libserde-c58c7af52c15bb63.rlib --extern serde_json=/home/some1and2/Documents/kyros-core/target/debug/deps/libserde_json-5a7e6043971d5ceb.rlib --extern shaderc=/home/some1and2/Documents/kyros-core/target/debug/deps/libshaderc-6d0326a4e62d1aa9.rlib --extern simple_logger=/home/some1and2/Documents/kyros-core/target/debug/deps/libsimple_logger-3b86ab3d937b61a7.rlib --extern strum=/home/some1and2/Documents/kyros-core/target/debug/deps/libstrum-a5ef98f5bdc5bb62.rlib --extern strum_macros=/home/some1and2/Documents/kyros-core/target/debug/deps/libstrum_macros-7e17501180e8780f.so --extern tokio=/home/some1and2/Documents/kyros-core/target/debug/deps/libtokio-147dbaa67c02c55a.rlib --extern tokio_stream=/home/some1and2/Documents/kyros-core/target/debug/deps/libtokio_stream-e76db5e04fb672db.rlib --extern tokio_util=/home/some1and2/Documents/kyros-core/target/debug/deps/libtokio_util-39ae97e38b4f8cf6.rlib --extern uuid=/home/some1and2/Documents/kyros-core/target/debug/deps/libuuid-80b1fdf38db36941.rlib --extern vulkano=/home/some1and2/Documents/kyros-core/target/debug/deps/libvulkano-7572c7a1392f6f16.rlib -L native=/home/some1and2/Documents/kyros-core/target/debug/build/libz-ng-sys-9a69eae174c21363/out/lib -L native=/home/some1and2/Documents/kyros-core/target/debug/build/libdeflate-sys-fb0eaaf39939fcb6/out/lib -L native=/home/some1and2/Documents/kyros-core/target/debug/build/shaderc-sys-1ae3e99ea66a16d5/out/lib` (exit status: 101)
Backtrace

thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:23:54:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: core::option::unwrap_failed
   4: <rustc_query_system::dep_graph::dep_node::DepNode as rustc_middle::dep_graph::dep_node::DepNodeExt>::extract_def_id
   5: rustc_query_impl::plumbing::force_from_dep_node::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>>
   6: <rustc_query_impl::plumbing::query_callback<rustc_query_impl::query_impl::type_of::QueryType>::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_query_system::dep_graph::dep_node::DepNode)>>::call_once
   7: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
   8: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
   9: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  10: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  11: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  12: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  13: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  14: <rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  15: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_type_ir::canonical::CanonicalQueryInput<rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<rustc_middle::ty::predicate::Predicate>>, rustc_middle::query::erase::Erased<[u8; 2]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
  16: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
  17: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
  18: rustc_traits::normalize_projection_ty::normalize_canonicalized_projection_ty
      [... omitted 2 frames ...]
  19: <rustc_trait_selection::traits::query::normalize::QueryNormalizer as rustc_type_ir::fold::FallibleTypeFolder<rustc_middle::ty::context::TyCtxt>>::try_fold_ty
  20: <&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_trait_selection::traits::query::normalize::QueryNormalizer>
  21: <rustc_middle::ty::Ty as rustc_type_ir::fold::TypeSuperFoldable<rustc_middle::ty::context::TyCtxt>>::try_super_fold_with::<rustc_trait_selection::traits::query::normalize::QueryNormalizer>
  22: <rustc_trait_selection::traits::query::normalize::QueryNormalizer as rustc_type_ir::fold::FallibleTypeFolder<rustc_middle::ty::context::TyCtxt>>::try_fold_ty
  23: <rustc_traits::normalize_erasing_regions::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::ty::PseudoCanonicalInput<rustc_middle::ty::generic_args::GenericArg>)>>::call_once
      [... omitted 1 frame ...]
  24: <rustc_middle::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_ty
  25: rustc_monomorphize::mono_checks::check_mono_item
      [... omitted 1 frame ...]
  26: rustc_monomorphize::collector::items_of_instance
      [... omitted 1 frame ...]
  27: rustc_monomorphize::collector::collect_items_rec::{closure#0}
  28: rustc_monomorphize::collector::collect_items_rec
  29: rustc_monomorphize::collector::collect_items_rec
  30: rustc_monomorphize::collector::collect_items_rec
  31: rustc_monomorphize::collector::collect_items_rec
  32: rustc_monomorphize::collector::collect_items_rec
  33: rustc_monomorphize::collector::collect_items_rec
  34: rustc_monomorphize::collector::collect_items_rec
  35: rustc_monomorphize::collector::collect_items_rec
  36: rustc_monomorphize::collector::collect_items_rec
  37: rustc_monomorphize::collector::collect_items_rec
  38: rustc_monomorphize::collector::collect_items_rec
  39: rustc_monomorphize::collector::collect_items_rec
  40: rustc_monomorphize::collector::collect_items_rec
  41: rustc_monomorphize::collector::collect_items_rec
  42: rustc_monomorphize::collector::collect_items_rec
  43: rustc_monomorphize::collector::collect_crate_mono_items
  44: rustc_monomorphize::partitioning::collect_and_partition_mono_items
      [... omitted 2 frames ...]
  45: rustc_codegen_ssa::base::codegen_crate::<rustc_codegen_llvm::LlvmCodegenBackend>
  46: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  47: <rustc_interface::queries::Linker>::codegen_and_build_linker
  48: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  49: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
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: rustc 1.86.0 (05f9846f8 2025-03-31) running on x86_64-unknown-linux-gnu

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:
#0 [evaluate_obligation] evaluating trait selection obligation `libkyros::dpo::dedicated_thread::DedicatedThread<libkyros::dpo::png_writer::PngWriter<std::io::buffered::bufwriter::BufWriter<std::fs::File>>>: core::marker::Send`
#1 [normalize_canonicalized_projection_ty] normalizing `<libkyros::dpo::compression::Compressor<libkyros::zlib::Zlib, libkyros::dpo::dedicated_thread::DedicatedThread<libkyros::dpo::png_writer::PngWriter<std::io::buffered::bufwriter::BufWriter<std::fs::File>>>> as libkyros::data_pipeline::PipelineObjectToAsyncTask>::{synthetic#0}`
#2 [try_normalize_generic_arg_after_erasing_regions] normalizing `tokio::task::spawn::spawn<<libkyros::dpo::compression::Compressor<libkyros::zlib::Zlib, libkyros::dpo::dedicated_thread::DedicatedThread<libkyros::dpo::png_writer::PngWriter<std::io::buffered::bufwriter::BufWriter<std::fs::File>>>> as libkyros::data_pipeline::PipelineObjectToAsyncTask>::{synthetic#0}>`
#3 [check_mono_item] monomorphization-time checking
#4 [items_of_instance] collecting items used by `libkyros::dpo::dedicated_thread::DedicatedThread::<libkyros::dpo::compression::Compressor<libkyros::zlib::Zlib, libkyros::dpo::dedicated_thread::DedicatedThread<libkyros::dpo::png_writer::PngWriter<std::io::buffered::bufwriter::BufWriter<std::fs::File>>>>>::new`
#5 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 TraitSelect(fc6705b5be260dc0-3f21805f2291d699)
#1 TraitSelect(317da9c3517e382f-1d0f9c385018b1af)
#2 TraitSelect(7a2525fd20b7b6e3-b02ef62a8a1b0a6d)
#3 TraitSelect(1928d509b13af827-52b6ae974b1b9423)
#4 TraitSelect(b524bb0a45ddf191-9b0e13a36e93d1ab)
#5 TraitSelect(55e9d91652dc3a9f-33b3aa729f245cab)
#6 TraitSelect(390aa7e7d1628e09-48abca5bbb8624ed)
#7 evaluate_obligation(fd72c031bb1e930c-a004fde036ad1393)
end of try_mark_green dep node stack
error: could not compile `kyros` (bin "kyros")

Caused by:
  process didn't exit successfully: `/home/some1and2/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc --crate-name kyros --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=157 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=1762e0f876e00a83 -C extra-filename=-49605bd643b1d14a --out-dir /home/some1and2/Documents/kyros-core/target/debug/deps -C incremental=/home/some1and2/Documents/kyros-core/target/debug/incremental -L dependency=/home/some1and2/Documents/kyros-core/target/debug/deps --extern ahash=/home/some1and2/Documents/kyros-core/target/debug/deps/libahash-0d6b1a35c8df6a1f.rlib --extern base64=/home/some1and2/Documents/kyros-core/target/debug/deps/libbase64-013c86e4129b6a32.rlib --extern bincode=/home/some1and2/Documents/kyros-core/target/debug/deps/libbincode-fbc02f37c0bcaf00.rlib --extern bytes=/home/some1and2/Documents/kyros-core/target/debug/deps/libbytes-c74caac21b6e312e.rlib --extern chrono=/home/some1and2/Documents/kyros-core/target/debug/deps/libchrono-4e594e64b147aaed.rlib --extern clap=/home/some1and2/Documents/kyros-core/target/debug/deps/libclap-70772f1ec5b3e52c.rlib --extern core_affinity=/home/some1and2/Documents/kyros-core/target/debug/deps/libcore_affinity-8357a1a682063768.rlib --extern cpu_time=/home/some1and2/Documents/kyros-core/target/debug/deps/libcpu_time-04a7ab8b7280f74d.rlib --extern csscolorparser=/home/some1and2/Documents/kyros-core/target/debug/deps/libcsscolorparser-cf8a30da43a59310.rlib --extern enum_delegate=/home/some1and2/Documents/kyros-core/target/debug/deps/libenum_delegate-ee4f60ae02f23951.so --extern flate2=/home/some1and2/Documents/kyros-core/target/debug/deps/libflate2-e942ce32237b6588.rlib --extern flume=/home/some1and2/Documents/kyros-core/target/debug/deps/libflume-faec93103db59854.rlib --extern futures=/home/some1and2/Documents/kyros-core/target/debug/deps/libfutures-dead497e7e8d4ea2.rlib --extern gzp=/home/some1and2/Documents/kyros-core/target/debug/deps/libgzp-aadcdc0dbd62f35a.rlib --extern hsv=/home/some1and2/Documents/kyros-core/target/debug/deps/libhsv-226c79f0d43f580e.rlib --extern image=/home/some1and2/Documents/kyros-core/target/debug/deps/libimage-70b1af5976efa45f.rlib --extern indicatif=/home/some1and2/Documents/kyros-core/target/debug/deps/libindicatif-3628dcba141a3bc3.rlib --extern libkyros=/home/some1and2/Documents/kyros-core/target/debug/deps/liblibkyros-1f1ed999054d11c5.rlib --extern lazy_static=/home/some1and2/Documents/kyros-core/target/debug/deps/liblazy_static-56fe2bd04ed1ed5a.rlib --extern libz_ng_sys=/home/some1and2/Documents/kyros-core/target/debug/deps/liblibz_ng_sys-acfa9f5d004641e3.rlib --extern log=/home/some1and2/Documents/kyros-core/target/debug/deps/liblog-ff97d2b12ce05993.rlib --extern minijinja=/home/some1and2/Documents/kyros-core/target/debug/deps/libminijinja-5de562a4f2edd7fc.rlib --extern ntest=/home/some1and2/Documents/kyros-core/target/debug/deps/libntest-78137898473299f2.rlib --extern png=/home/some1and2/Documents/kyros-core/target/debug/deps/libpng-8b52c0c299f5d216.rlib --extern serde=/home/some1and2/Documents/kyros-core/target/debug/deps/libserde-c58c7af52c15bb63.rlib --extern serde_json=/home/some1and2/Documents/kyros-core/target/debug/deps/libserde_json-5a7e6043971d5ceb.rlib --extern shaderc=/home/some1and2/Documents/kyros-core/target/debug/deps/libshaderc-6d0326a4e62d1aa9.rlib --extern simple_logger=/home/some1and2/Documents/kyros-core/target/debug/deps/libsimple_logger-3b86ab3d937b61a7.rlib --extern strum=/home/some1and2/Documents/kyros-core/target/debug/deps/libstrum-a5ef98f5bdc5bb62.rlib --extern strum_macros=/home/some1and2/Documents/kyros-core/target/debug/deps/libstrum_macros-7e17501180e8780f.so --extern tokio=/home/some1and2/Documents/kyros-core/target/debug/deps/libtokio-147dbaa67c02c55a.rlib --extern tokio_stream=/home/some1and2/Documents/kyros-core/target/debug/deps/libtokio_stream-e76db5e04fb672db.rlib --extern tokio_util=/home/some1and2/Documents/kyros-core/target/debug/deps/libtokio_util-39ae97e38b4f8cf6.rlib --extern uuid=/home/some1and2/Documents/kyros-core/target/debug/deps/libuuid-80b1fdf38db36941.rlib --extern vulkano=/home/some1and2/Documents/kyros-core/target/debug/deps/libvulkano-7572c7a1392f6f16.rlib -L native=/home/some1and2/Documents/kyros-core/target/debug/build/libz-ng-sys-9a69eae174c21363/out/lib -L native=/home/some1and2/Documents/kyros-core/target/debug/build/libdeflate-sys-fb0eaaf39939fcb6/out/lib -L native=/home/some1and2/Documents/kyros-core/target/debug/build/shaderc-sys-1ae3e99ea66a16d5/out/lib` (exit status: 101)

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 by minimizing the described complex trait and pipeline example into a repeatable reproducer, then run it with the reported rustc version and flags. Inspect compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs alongside the query stack around trait selection and monomorphization. Done means a reproducible regression test exists and the compiler no longer panics for that case.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.