ICE: associated type missing default · Issue #129216 · rust-lang/rust (original) (raw)

error: internal compiler error: compiler/rustc_hir_analysis/src/collect/type_of.rs:451:17: associated type missing default
 --> /tmp/icemaker_global_tempdir.thuP8tncCjle/rustc_testrunner_tmpdir_reporting.6TKvJE1HmZsD/mvce.rs:2:5
  |
2 |     type Assoc;
  |     ^^^^^^^^^^^

thread 'rustc' panicked at compiler/rustc_hir_analysis/src/collect/type_of.rs:451:17:
Box<dyn Any>
stack backtrace:
   0:     0x7ebe535c429d - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hce35dec2bed7e8e1
   1:     0x7ebe53e05297 - core::fmt::write::haaf8a728f3019c12
   2:     0x7ebe550bbd91 - std::io::Write::write_fmt::hb0dc5188703aea0d
   3:     0x7ebe535c697b - std::panicking::default_hook::{{closure}}::h35c501ae74c82675
   4:     0x7ebe535c65ee - std::panicking::default_hook::hc1ddd62643c4c855
   5:     0x7ebe52758729 - std[54b021f941472252]::panicking::update_hook::<alloc[8840b3d3a55bb7af]::boxed::Box<rustc_driver_impl[ec4d44b725e7aa11]::install_ice_hook::{closure#0}>>::{closure#0}
   6:     0x7ebe535c7297 - std::panicking::rust_panic_with_hook::h7960ad04eaeb646d
   7:     0x7ebe52793111 - std[54b021f941472252]::panicking::begin_panic::<rustc_errors[2e519a482e3c741a]::ExplicitBug>::{closure#0}
   8:     0x7ebe52786156 - std[54b021f941472252]::sys::backtrace::__rust_end_short_backtrace::<std[54b021f941472252]::panicking::begin_panic<rustc_errors[2e519a482e3c741a]::ExplicitBug>::{closure#0}, !>
   9:     0x7ebe52781536 - std[54b021f941472252]::panicking::begin_panic::<rustc_errors[2e519a482e3c741a]::ExplicitBug>
  10:     0x7ebe5279c0f1 - <rustc_errors[2e519a482e3c741a]::diagnostic::BugAbort as rustc_errors[2e519a482e3c741a]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  11:     0x7ebe52820b1f - <rustc_errors[2e519a482e3c741a]::DiagCtxtHandle>::span_bug::<rustc_span[a5a4c6b08f7cf6f]::span_encoding::Span, alloc[8840b3d3a55bb7af]:🧵:String>
  12:     0x7ebe52881528 - rustc_middle[10ec7aec7d9fdda3]::util:🐛:opt_span_bug_fmt::<rustc_span[a5a4c6b08f7cf6f]::span_encoding::Span>::{closure#0}
  13:     0x7ebe5288525a - rustc_middle[10ec7aec7d9fdda3]::ty::context::tls::with_opt::<rustc_middle[10ec7aec7d9fdda3]::util:🐛:opt_span_bug_fmt<rustc_span[a5a4c6b08f7cf6f]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x7ebe52848f9b - rustc_middle[10ec7aec7d9fdda3]::ty::context::tls::with_context_opt::<rustc_middle[10ec7aec7d9fdda3]::ty::context::tls::with_opt<rustc_middle[10ec7aec7d9fdda3]::util:🐛:opt_span_bug_fmt<rustc_span[a5a4c6b08f7cf6f]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:     0x7ebe52848807 - rustc_middle[10ec7aec7d9fdda3]::util:🐛:span_bug_fmt::<rustc_span[a5a4c6b08f7cf6f]::span_encoding::Span>
  16:     0x7ebe5147fba4 - rustc_hir_analysis[c0d9d1e917b71b24]::collect::type_of::type_of
  17:     0x7ebe53e271f0 - rustc_query_impl[69287ea093d06d1d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[69287ea093d06d1d]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[10ec7aec7d9fdda3]::query::erase::Erased<[u8; 8usize]>>
  18:     0x7ebe53e25ea7 - rustc_query_system[1449707d44461b06]::query::plumbing::try_execute_query::<rustc_query_impl[69287ea093d06d1d]::DynamicConfig<rustc_query_system[1449707d44461b06]::query::caches::DefIdCache<rustc_middle[10ec7aec7d9fdda3]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[69287ea093d06d1d]::plumbing::QueryCtxt, false>
  19:     0x7ebe53e25a67 - rustc_query_impl[69287ea093d06d1d]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  20:     0x7ebe542f4751 - rustc_middle[10ec7aec7d9fdda3]::query::plumbing::query_get_at::<rustc_query_system[1449707d44461b06]::query::caches::DefIdCache<rustc_middle[10ec7aec7d9fdda3]::query::erase::Erased<[u8; 8usize]>>>
  21:     0x7ebe52a9e0f3 - <rustc_hir_typeck[cd6451a3b3fe12c4]::fn_ctxt::FnCtxt>::suggest_traits_to_import
  22:     0x7ebe52a8b20a - <rustc_hir_typeck[cd6451a3b3fe12c4]::fn_ctxt::FnCtxt>::report_no_match_method_error
  23:     0x7ebe52abf32a - <rustc_hir_typeck[cd6451a3b3fe12c4]::fn_ctxt::FnCtxt>::report_method_error
  24:     0x7ebe5480e190 - <rustc_hir_typeck[cd6451a3b3fe12c4]::fn_ctxt::FnCtxt>::check_expr_path
  25:     0x7ebe54900058 - <rustc_hir_typeck[cd6451a3b3fe12c4]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  26:     0x7ebe5490178d - <rustc_hir_typeck[cd6451a3b3fe12c4]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  27:     0x7ebe548fad7d - <rustc_hir_typeck[cd6451a3b3fe12c4]::fn_ctxt::FnCtxt>::check_block_with_expected
  28:     0x7ebe54902247 - <rustc_hir_typeck[cd6451a3b3fe12c4]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  29:     0x7ebe54043661 - rustc_hir_typeck[cd6451a3b3fe12c4]::check::check_fn
  30:     0x7ebe545fbf1f - rustc_hir_typeck[cd6451a3b3fe12c4]::typeck
  31:     0x7ebe545fb975 - rustc_query_impl[69287ea093d06d1d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[69287ea093d06d1d]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[10ec7aec7d9fdda3]::query::erase::Erased<[u8; 8usize]>>
  32:     0x7ebe540d4bf9 - rustc_query_system[1449707d44461b06]::query::plumbing::try_execute_query::<rustc_query_impl[69287ea093d06d1d]::DynamicConfig<rustc_query_system[1449707d44461b06]::query::caches::VecCache<rustc_span[a5a4c6b08f7cf6f]::def_id::LocalDefId, rustc_middle[10ec7aec7d9fdda3]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[69287ea093d06d1d]::plumbing::QueryCtxt, false>
  33:     0x7ebe540d3e15 - rustc_query_impl[69287ea093d06d1d]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
  34:     0x7ebe540d3a9b - <rustc_middle[10ec7aec7d9fdda3]::hir::map::Map>::par_body_owners::<rustc_hir_analysis[c0d9d1e917b71b24]::check_crate::{closure#4}>::{closure#0}
  35:     0x7ebe540d17e4 - rustc_hir_analysis[c0d9d1e917b71b24]::check_crate
  36:     0x7ebe54584cbf - rustc_interface[f40e7651e6b02ea1]::passes::run_required_analyses
  37:     0x7ebe5495c49e - rustc_interface[f40e7651e6b02ea1]::passes::analysis
  38:     0x7ebe5495c471 - rustc_query_impl[69287ea093d06d1d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[69287ea093d06d1d]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[10ec7aec7d9fdda3]::query::erase::Erased<[u8; 1usize]>>
  39:     0x7ebe54d867ee - rustc_query_system[1449707d44461b06]::query::plumbing::try_execute_query::<rustc_query_impl[69287ea093d06d1d]::DynamicConfig<rustc_query_system[1449707d44461b06]::query::caches::SingleCache<rustc_middle[10ec7aec7d9fdda3]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[69287ea093d06d1d]::plumbing::QueryCtxt, false>
  40:     0x7ebe54d8654f - rustc_query_impl[69287ea093d06d1d]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  41:     0x7ebe54bd38ea - rustc_interface[f40e7651e6b02ea1]::interface::run_compiler::<core[5070cb7ec77c977]::result::Result<(), rustc_span[a5a4c6b08f7cf6f]::ErrorGuaranteed>, rustc_driver_impl[ec4d44b725e7aa11]::run_compiler::{closure#0}>::{closure#1}
  42:     0x7ebe54bb3210 - std[54b021f941472252]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[f40e7651e6b02ea1]::util::run_in_thread_with_globals<rustc_interface[f40e7651e6b02ea1]::util::run_in_thread_pool_with_globals<rustc_interface[f40e7651e6b02ea1]::interface::run_compiler<core[5070cb7ec77c977]::result::Result<(), rustc_span[a5a4c6b08f7cf6f]::ErrorGuaranteed>, rustc_driver_impl[ec4d44b725e7aa11]::run_compiler::{closure#0}>::{closure#1}, core[5070cb7ec77c977]::result::Result<(), rustc_span[a5a4c6b08f7cf6f]::ErrorGuaranteed>>::{closure#0}, core[5070cb7ec77c977]::result::Result<(), rustc_span[a5a4c6b08f7cf6f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[5070cb7ec77c977]::result::Result<(), rustc_span[a5a4c6b08f7cf6f]::ErrorGuaranteed>>
  43:     0x7ebe54bb387a - <<std[54b021f941472252]::thread::Builder>::spawn_unchecked_<rustc_interface[f40e7651e6b02ea1]::util::run_in_thread_with_globals<rustc_interface[f40e7651e6b02ea1]::util::run_in_thread_pool_with_globals<rustc_interface[f40e7651e6b02ea1]::interface::run_compiler<core[5070cb7ec77c977]::result::Result<(), rustc_span[a5a4c6b08f7cf6f]::ErrorGuaranteed>, rustc_driver_impl[ec4d44b725e7aa11]::run_compiler::{closure#0}>::{closure#1}, core[5070cb7ec77c977]::result::Result<(), rustc_span[a5a4c6b08f7cf6f]::ErrorGuaranteed>>::{closure#0}, core[5070cb7ec77c977]::result::Result<(), rustc_span[a5a4c6b08f7cf6f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[5070cb7ec77c977]::result::Result<(), rustc_span[a5a4c6b08f7cf6f]::ErrorGuaranteed>>::{closure#1} as core[5070cb7ec77c977]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  44:     0x7ebe54bb3beb - std::sys::pal::unix::thread::Thread:🆕:thread_start::he8fde62ed04f9a93
  45:     0x7ebe5635e39d - <unknown>
  46:     0x7ebe563e349c - <unknown>
  47:                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.82.0-nightly (0f26ee4fd 2024-08-17) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [type_of] computing type of `Mirror::Assoc`
#1 [typeck] type-checking `main`
end of query stack
error: aborting due to 1 previous error