Skip to content
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

ICE: missing associated_item_or_field_def_ids for DefId #137554

Open
matthiaskrgr opened this issue Feb 24, 2025 · 1 comment
Open

ICE: missing associated_item_or_field_def_ids for DefId #137554

matthiaskrgr opened this issue Feb 24, 2025 · 1 comment
Labels
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

snippet:

fn main() -> dyn Iterator + ?Iterator::advance_by(usize) {
    todo!()
}

Version information

rustc 1.87.0-nightly (e0be1a026 2025-02-24)
binary: rustc
commit-hash: e0be1a02626abef2878cb7f4aaef7ae409477112
commit-date: 2025-02-24
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 20.1.0

Possibly related line of code:

self.target_modifiers.decode(metadata)
}
}
impl<'a> CrateMetadataRef<'a> {
fn missing(self, descr: &str, id: DefIndex) -> ! {
bug!("missing `{descr}` for {:?}", self.local_def_id(id))
}
fn raw_proc_macro(self, id: DefIndex) -> &'a ProcMacro {
// DefIndex's in root.proc_macro_data have a one-to-one correspondence
// with items in 'raw_proc_macros'.
let pos = self

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error[E0658]: `?Trait` is not permitted in trait object types
 --> /tmp/icemaker_global_tempdir.GmrobLH26bcS/rustc_testrunner_tmpdir_reporting.71dArq3UUixW/mvce.rs:1:29
  |
1 | fn main() -> dyn Iterator + ?Iterator::advance_by(usize) {
  |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: add `#![feature(more_maybe_bounds)]` to the crate attributes to enable
  = note: this compiler was built on 2025-02-24; consider upgrading it if it is out of date

error[E0404]: expected trait, found associated function `Iterator::advance_by`
 --> /tmp/icemaker_global_tempdir.GmrobLH26bcS/rustc_testrunner_tmpdir_reporting.71dArq3UUixW/mvce.rs:1:30
  |
1 | fn main() -> dyn Iterator + ?Iterator::advance_by(usize) {
  |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a trait

error: internal compiler error: compiler/rustc_metadata/src/rmeta/decoder.rs:979:9: missing `associated_item_or_field_def_ids` for DefId(2:9144 ~ core[90b8]::iter::traits::iterator::Iterator::advance_by)


thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/decoder.rs:979:9:
Box<dyn Any>
stack backtrace:
   0:     0x75161697c124 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hd9ec0f3056d90740
   1:     0x75161701632c - core::fmt::write::h0d8376a499e0871d
   2:     0x751618095a51 - std::io::Write::write_fmt::hf688cf9460f28ca2
   3:     0x75161697bf82 - std::sys::backtrace::BacktraceLock::print::h4ca5e45855090a7a
   4:     0x75161697e78e - std::panicking::default_hook::{{closure}}::h181472065423d3d9
   5:     0x75161697e364 - std::panicking::default_hook::h68110b3f28030711
   6:     0x751615adda87 - std[6ca4657e2107f847]::panicking::update_hook::<alloc[a2d81cc64f826ec1]::boxed::Box<rustc_driver_impl[3593385ee6d6136e]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x75161697f003 - std::panicking::rust_panic_with_hook::h0802d830fc76ae3f
   8:     0x751615b19b81 - std[6ca4657e2107f847]::panicking::begin_panic::<rustc_errors[db683afb8460ed88]::ExplicitBug>::{closure#0}
   9:     0x751615b0df96 - std[6ca4657e2107f847]::sys::backtrace::__rust_end_short_backtrace::<std[6ca4657e2107f847]::panicking::begin_panic<rustc_errors[db683afb8460ed88]::ExplicitBug>::{closure#0}, !>
  10:     0x751615b0a919 - std[6ca4657e2107f847]::panicking::begin_panic::<rustc_errors[db683afb8460ed88]::ExplicitBug>
  11:     0x751615b23581 - <rustc_errors[db683afb8460ed88]::diagnostic::BugAbort as rustc_errors[db683afb8460ed88]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x7516160f3026 - rustc_middle[d80101abd097f72b]::util::bug::opt_span_bug_fmt::<rustc_span[74cd7f09f1ca77f9]::span_encoding::Span>::{closure#0}
  13:     0x7516160dc58a - rustc_middle[d80101abd097f72b]::ty::context::tls::with_opt::<rustc_middle[d80101abd097f72b]::util::bug::opt_span_bug_fmt<rustc_span[74cd7f09f1ca77f9]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x7516160dc3fb - rustc_middle[d80101abd097f72b]::ty::context::tls::with_context_opt::<rustc_middle[d80101abd097f72b]::ty::context::tls::with_opt<rustc_middle[d80101abd097f72b]::util::bug::opt_span_bug_fmt<rustc_span[74cd7f09f1ca77f9]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:     0x7516144ccbc0 - rustc_middle[d80101abd097f72b]::util::bug::bug_fmt
  16:     0x751616058fcf - <rustc_metadata[48f9dac3cd275b9a]::creader::CrateMetadataRef>::missing
  17:     0x7516172c1962 - rustc_metadata[48f9dac3cd275b9a]::rmeta::decoder::cstore_impl::provide_extern::associated_item_def_ids
  18:     0x7516172c12e3 - rustc_query_impl[a3e1d005031b8bb]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a3e1d005031b8bb]::query_impl::associated_item_def_ids::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d80101abd097f72b]::query::erase::Erased<[u8; 16usize]>>
  19:     0x7516172c1289 - <rustc_query_impl[a3e1d005031b8bb]::query_impl::associated_item_def_ids::dynamic_query::{closure#2} as core[90b8396b6039faa7]::ops::function::FnOnce<(rustc_middle[d80101abd097f72b]::ty::context::TyCtxt, rustc_span[74cd7f09f1ca77f9]::def_id::DefId)>>::call_once
  20:     0x7516172bf74f - rustc_query_system[de6c792d11e5b678]::query::plumbing::try_execute_query::<rustc_query_impl[a3e1d005031b8bb]::DynamicConfig<rustc_query_system[de6c792d11e5b678]::query::caches::DefIdCache<rustc_middle[d80101abd097f72b]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[a3e1d005031b8bb]::plumbing::QueryCtxt, false>
  21:     0x7516172bf1e1 - rustc_query_impl[a3e1d005031b8bb]::query_impl::associated_item_def_ids::get_query_non_incr::__rust_end_short_backtrace
  22:     0x7516179ec7a1 - rustc_ty_utils[b051470940286a68]::assoc::associated_items
  23:     0x7516179ec634 - rustc_query_impl[a3e1d005031b8bb]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a3e1d005031b8bb]::query_impl::associated_items::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d80101abd097f72b]::query::erase::Erased<[u8; 8usize]>>
  24:     0x75161711b272 - rustc_query_system[de6c792d11e5b678]::query::plumbing::try_execute_query::<rustc_query_impl[a3e1d005031b8bb]::DynamicConfig<rustc_query_system[de6c792d11e5b678]::query::caches::DefIdCache<rustc_middle[d80101abd097f72b]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[a3e1d005031b8bb]::plumbing::QueryCtxt, false>
  25:     0x75161711c4a8 - rustc_query_impl[a3e1d005031b8bb]::query_impl::associated_items::get_query_non_incr::__rust_end_short_backtrace
  26:     0x751617858458 - rustc_middle[d80101abd097f72b]::query::plumbing::query_get_at::<rustc_query_system[de6c792d11e5b678]::query::caches::DefIdCache<rustc_middle[d80101abd097f72b]::query::erase::Erased<[u8; 8usize]>>>
  27:     0x751615c22fcf - <core[90b8396b6039faa7]::iter::adapters::flatten::FlattenCompat<_, _> as core[90b8396b6039faa7]::iter::traits::iterator::Iterator>::fold::flatten::<core[90b8396b6039faa7]::iter::adapters::filter_map::FilterMap<core[90b8396b6039faa7]::slice::iter::Iter<rustc_hir[6e224bfe6d508dae]::hir::AssocItemConstraint>, <dyn rustc_hir_analysis[da7d2587c78354bd]::hir_ty_lowering::HirTyLowerer>::check_for_required_assoc_tys::{closure#1}::{closure#0}>, (), core[90b8396b6039faa7]::iter::traits::iterator::Iterator::for_each::call<(rustc_span[74cd7f09f1ca77f9]::symbol::Symbol, &rustc_middle[d80101abd097f72b]::ty::assoc::AssocItem), <hashbrown[ed219d29d174ff2d]::map::HashMap<rustc_span[74cd7f09f1ca77f9]::symbol::Symbol, &rustc_middle[d80101abd097f72b]::ty::assoc::AssocItem, rustc_hash[733386de75a58a40]::FxBuildHasher> as core[90b8396b6039faa7]::iter::traits::collect::Extend<(rustc_span[74cd7f09f1ca77f9]::symbol::Symbol, &rustc_middle[d80101abd097f72b]::ty::assoc::AssocItem)>>::extend<core[90b8396b6039faa7]::iter::adapters::flatten::Flatten<core[90b8396b6039faa7]::iter::adapters::filter_map::FilterMap<core[90b8396b6039faa7]::slice::iter::Iter<rustc_hir[6e224bfe6d508dae]::hir::PolyTraitRef>, <dyn rustc_hir_analysis[da7d2587c78354bd]::hir_ty_lowering::HirTyLowerer>::check_for_required_assoc_tys::{closure#1}>>>::{closure#0}>::{closure#0}>::{closure#0}
  28:     0x751617ee2e84 - <dyn rustc_hir_analysis[da7d2587c78354bd]::hir_ty_lowering::HirTyLowerer>::lower_trait_object_ty
  29:     0x7516178d5786 - <dyn rustc_hir_analysis[da7d2587c78354bd]::hir_ty_lowering::HirTyLowerer>::lower_ty
  30:     0x7516178ce0d5 - <dyn rustc_hir_analysis[da7d2587c78354bd]::hir_ty_lowering::HirTyLowerer>::lower_fn_ty
  31:     0x7516178cd969 - rustc_hir_analysis[da7d2587c78354bd]::collect::lower_fn_sig_recovering_infer_ret_ty
  32:     0x7516178cb8dd - rustc_hir_analysis[da7d2587c78354bd]::collect::fn_sig
  33:     0x7516172c6bad - rustc_query_impl[a3e1d005031b8bb]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a3e1d005031b8bb]::query_impl::fn_sig::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d80101abd097f72b]::query::erase::Erased<[u8; 24usize]>>
  34:     0x7516172c6b6d - <rustc_query_impl[a3e1d005031b8bb]::query_impl::fn_sig::dynamic_query::{closure#2} as core[90b8396b6039faa7]::ops::function::FnOnce<(rustc_middle[d80101abd097f72b]::ty::context::TyCtxt, rustc_span[74cd7f09f1ca77f9]::def_id::DefId)>>::call_once
  35:     0x7516172c98ba - rustc_query_system[de6c792d11e5b678]::query::plumbing::try_execute_query::<rustc_query_impl[a3e1d005031b8bb]::DynamicConfig<rustc_query_system[de6c792d11e5b678]::query::caches::DefIdCache<rustc_middle[d80101abd097f72b]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[a3e1d005031b8bb]::plumbing::QueryCtxt, false>
  36:     0x7516172c8fad - rustc_query_impl[a3e1d005031b8bb]::query_impl::fn_sig::get_query_non_incr::__rust_end_short_backtrace
  37:     0x7516178884a3 - <rustc_hir_analysis[da7d2587c78354bd]::collect::CollectItemTypesVisitor as rustc_hir[6e224bfe6d508dae]::intravisit::Visitor>::visit_item
  38:     0x75161787b3bb - rustc_hir_analysis[da7d2587c78354bd]::check::wfcheck::check_well_formed
  39:     0x75161787b1cd - rustc_query_impl[a3e1d005031b8bb]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a3e1d005031b8bb]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d80101abd097f72b]::query::erase::Erased<[u8; 1usize]>>
  40:     0x75161787ac84 - rustc_query_system[de6c792d11e5b678]::query::plumbing::try_execute_query::<rustc_query_impl[a3e1d005031b8bb]::DynamicConfig<rustc_data_structures[f99b040610e16207]::vec_cache::VecCache<rustc_span[74cd7f09f1ca77f9]::def_id::LocalDefId, rustc_middle[d80101abd097f72b]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[de6c792d11e5b678]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[a3e1d005031b8bb]::plumbing::QueryCtxt, false>
  41:     0x75161787a73f - rustc_query_impl[a3e1d005031b8bb]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
  42:     0x751617877f5d - rustc_hir_analysis[da7d2587c78354bd]::check::wfcheck::check_mod_type_wf
  43:     0x751617877d5f - rustc_query_impl[a3e1d005031b8bb]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a3e1d005031b8bb]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d80101abd097f72b]::query::erase::Erased<[u8; 1usize]>>
  44:     0x751617fd6e16 - rustc_query_system[de6c792d11e5b678]::query::plumbing::try_execute_query::<rustc_query_impl[a3e1d005031b8bb]::DynamicConfig<rustc_query_system[de6c792d11e5b678]::query::caches::DefaultCache<rustc_span[74cd7f09f1ca77f9]::def_id::LocalModDefId, rustc_middle[d80101abd097f72b]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[a3e1d005031b8bb]::plumbing::QueryCtxt, false>
  45:     0x751617fd6bbf - rustc_query_impl[a3e1d005031b8bb]::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
  46:     0x7516173256e9 - rustc_hir_analysis[da7d2587c78354bd]::check_crate
  47:     0x7516173a5d5c - rustc_interface[ccf5b96b158150d5]::passes::run_required_analyses
  48:     0x7516180919fa - rustc_interface[ccf5b96b158150d5]::passes::analysis
  49:     0x7516180919d9 - rustc_query_impl[a3e1d005031b8bb]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a3e1d005031b8bb]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d80101abd097f72b]::query::erase::Erased<[u8; 0usize]>>
  50:     0x7516180f570b - rustc_query_system[de6c792d11e5b678]::query::plumbing::try_execute_query::<rustc_query_impl[a3e1d005031b8bb]::DynamicConfig<rustc_query_system[de6c792d11e5b678]::query::caches::SingleCache<rustc_middle[d80101abd097f72b]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[a3e1d005031b8bb]::plumbing::QueryCtxt, false>
  51:     0x7516180f53f9 - rustc_query_impl[a3e1d005031b8bb]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  52:     0x7516180d78bc - rustc_interface[ccf5b96b158150d5]::passes::create_and_enter_global_ctxt::<core[90b8396b6039faa7]::option::Option<rustc_interface[ccf5b96b158150d5]::queries::Linker>, rustc_driver_impl[3593385ee6d6136e]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  53:     0x7516180cb160 - rustc_interface[ccf5b96b158150d5]::interface::run_compiler::<(), rustc_driver_impl[3593385ee6d6136e]::run_compiler::{closure#0}>::{closure#1}
  54:     0x751617fa6d48 - std[6ca4657e2107f847]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[ccf5b96b158150d5]::util::run_in_thread_with_globals<rustc_interface[ccf5b96b158150d5]::util::run_in_thread_pool_with_globals<rustc_interface[ccf5b96b158150d5]::interface::run_compiler<(), rustc_driver_impl[3593385ee6d6136e]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  55:     0x751617fa7174 - <<std[6ca4657e2107f847]::thread::Builder>::spawn_unchecked_<rustc_interface[ccf5b96b158150d5]::util::run_in_thread_with_globals<rustc_interface[ccf5b96b158150d5]::util::run_in_thread_pool_with_globals<rustc_interface[ccf5b96b158150d5]::interface::run_compiler<(), rustc_driver_impl[3593385ee6d6136e]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[90b8396b6039faa7]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  56:     0x751617fa7aeb - std::sys::pal::unix::thread::Thread::new::thread_start::he66ac63033b645ec
  57:     0x7516122a370a - <unknown>
  58:     0x751612327aac - <unknown>
  59:                0x0 - <unknown>

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: rustc 1.87.0-nightly (e0be1a026 2025-02-24) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [associated_item_def_ids] collecting associated items or fields of `core::iter::traits::iterator::Iterator::advance_by`
#1 [associated_items] collecting associated items of `core::iter::traits::iterator::Iterator::advance_by`
#2 [fn_sig] computing function signature of `main`
#3 [check_well_formed] checking that `main` is well-formed
#4 [check_mod_type_wf] checking that types are well-formed in top-level module
#5 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 3 previous errors

Some errors have detailed explanations: E0404, E0658.
For more information about an error, try `rustc --explain E0404`.

@matthiaskrgr matthiaskrgr added C-bug Category: This is a bug. 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. labels Feb 24, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 24, 2025
@cyrgani
Copy link
Contributor

cyrgani commented Feb 24, 2025

duplicate of #137508

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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