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: generic const exprs: missing value for assoc item in impl, expected fulfillment errors #117153

Closed
matthiaskrgr opened this issue Oct 25, 2023 · 3 comments · Fixed by #117159
Labels
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.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Oct 25, 2023

original:

#![feature(generic_const_exprs)]

trait Q {
    const ASSOC: usize;
}

impl<const N: u64> Q for [u8; N] {}

pub fn q_user() -> [u8; <[u8; 13] as Q>::ASSOC] {}

pub fn main() {}

Version information

rustc 1.75.0-nightly (2e4e2a8f2 2023-10-25)
binary: rustc
commit-hash: 2e4e2a8f288f642cafcc41fff211955ceddc453d
commit-date: 2023-10-25
host: x86_64-unknown-linux-gnu
release: 1.75.0-nightly
LLVM version: 17.0.3

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

Program output

warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> <crate attribute>:1:9
  |
1 | feature(generic_const_exprs)
  |         ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
  = note: `#[warn(incomplete_features)]` on by default

warning: 1 warning emitted

error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: cannot relate consts of different types (a=13_usize, b=?0c: u64)
  |
  = note: delayed at compiler/rustc_infer/src/infer/combine.rs:178:31
             0: <rustc_errors::HandlerInner>::emit_diagnostic
             1: <rustc_session::session::Session>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
             2: <rustc_infer::infer::InferCtxt>::super_combine_consts::<rustc_infer::infer::equate::Equate>
             3: <rustc_infer::infer::InferCtxt>::super_combine_tys::<rustc_infer::infer::equate::Equate>
             4: <rustc_infer::infer::equate::Equate as rustc_middle::ty::relate::TypeRelation>::tys
             5: <rustc_trait_selection::traits::select::SelectionContext>::match_impl
             6: <rustc_trait_selection::traits::select::SelectionContext>::assemble_candidates_from_impls
             7: <rustc_trait_selection::traits::select::SelectionContext>::candidate_from_obligation_no_cache
             8: <rustc_trait_selection::traits::select::SelectionContext>::candidate_from_obligation
             9: <rustc_trait_selection::traits::select::SelectionContext>::evaluate_trait_predicate_recursively
            10: <rustc_trait_selection::traits::select::SelectionContext>::evaluation_probe::<<rustc_trait_selection::traits::select::SelectionContext>::evaluate_root_obligation::{closure#0}>
            11: rustc_traits::evaluate_obligation::evaluate_obligation
            12: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::evaluate_obligation::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 2]>>
            13: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_middle::infer::canonical::Canonical<rustc_middle::ty::ParamEnvAnd<rustc_middle::ty::Predicate>>, rustc_middle::query::erase::Erased<[u8; 2]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            14: rustc_query_impl::query_impl::evaluate_obligation::get_query_non_incr::__rust_end_short_backtrace
            15: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
            16: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
            17: <rustc_hir_typeck::fn_ctxt::FnCtxt>::type_inference_fallback
            18: rustc_hir_typeck::typeck
            19: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
            20: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            21: rustc_query_impl::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
            22: rustc_mir_build::thir::cx::thir_body
            23: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::thir_body::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 16]>>
            24: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 16]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            25: rustc_query_impl::query_impl::thir_body::get_query_non_incr::__rust_end_short_backtrace
            26: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 16]>>>
            27: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::thir_abstract_const::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 16]>>
            28: <rustc_query_impl::query_impl::thir_abstract_const::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId)>>::call_once
            29: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 16]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            30: rustc_query_impl::query_impl::thir_abstract_const::get_query_non_incr::__rust_end_short_backtrace
            31: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 16]>>>
            32: <<rustc_middle::ty::context::TyCtxt>::expand_abstract_consts::Expander as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_const
            33: rustc_trait_selection::traits::const_evaluatable::is_const_evaluatable
            34: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
            35: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
            36: <rustc_trait_selection::traits::engine::ObligationCtxt>::assumed_wf_types
            37: rustc_hir_analysis::check::wfcheck::check_item_fn
            38: rustc_hir_analysis::check::wfcheck::check_well_formed
            39: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
            40: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_hir::hir_id::OwnerId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            41: rustc_query_impl::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
            42: rustc_hir_analysis::check::wfcheck::check_mod_type_wf
            43: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
            44: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalModDefId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            45: rustc_query_impl::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
            46: rustc_hir_analysis::check_crate
            47: rustc_interface::passes::analysis
            48: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
            49: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            50: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
            51: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            52: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            53: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/alloc/src/boxed.rs:2007:9
            54: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/alloc/src/boxed.rs:2007:9
            55: std::sys::unix::thread::Thread::new::thread_start
                       at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/std/src/sys/unix/thread.rs:108:17
            56: <unknown>
            57: <unknown>


error: internal compiler error: cannot relate consts of different types (a=13_usize, b=?0c: u64)
  |
  = note: delayed at compiler/rustc_infer/src/infer/combine.rs:178:31
             0: <rustc_errors::HandlerInner>::emit_diagnostic
             1: <rustc_session::session::Session>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
             2: <rustc_infer::infer::InferCtxt>::super_combine_consts::<rustc_infer::infer::equate::Equate>
             3: <rustc_infer::infer::InferCtxt>::super_combine_tys::<rustc_infer::infer::equate::Equate>
             4: <rustc_infer::infer::equate::Equate as rustc_middle::ty::relate::TypeRelation>::tys
             5: <rustc_trait_selection::traits::select::SelectionContext>::confirm_candidate
             6: <rustc_trait_selection::traits::select::SelectionContext>::evaluate_candidate
             7: <rustc_trait_selection::traits::select::SelectionContext>::evaluate_trait_predicate_recursively
             8: <rustc_trait_selection::traits::select::SelectionContext>::evaluation_probe::<<rustc_trait_selection::traits::select::SelectionContext>::evaluate_root_obligation::{closure#0}>
             9: rustc_traits::evaluate_obligation::evaluate_obligation
            10: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::evaluate_obligation::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 2]>>
            11: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_middle::infer::canonical::Canonical<rustc_middle::ty::ParamEnvAnd<rustc_middle::ty::Predicate>>, rustc_middle::query::erase::Erased<[u8; 2]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            12: rustc_query_impl::query_impl::evaluate_obligation::get_query_non_incr::__rust_end_short_backtrace
            13: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
            14: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
            15: <rustc_hir_typeck::fn_ctxt::FnCtxt>::type_inference_fallback
            16: rustc_hir_typeck::typeck
            17: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
            18: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            19: rustc_query_impl::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
            20: rustc_mir_build::thir::cx::thir_body
            21: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::thir_body::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 16]>>
            22: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 16]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            23: rustc_query_impl::query_impl::thir_body::get_query_non_incr::__rust_end_short_backtrace
            24: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 16]>>>
            25: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::thir_abstract_const::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 16]>>
            26: <rustc_query_impl::query_impl::thir_abstract_const::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId)>>::call_once
            27: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 16]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            28: rustc_query_impl::query_impl::thir_abstract_const::get_query_non_incr::__rust_end_short_backtrace
            29: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 16]>>>
            30: <<rustc_middle::ty::context::TyCtxt>::expand_abstract_consts::Expander as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_const
            31: rustc_trait_selection::traits::const_evaluatable::is_const_evaluatable
            32: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
            33: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
            34: <rustc_trait_selection::traits::engine::ObligationCtxt>::assumed_wf_types
            35: rustc_hir_analysis::check::wfcheck::check_item_fn
            36: rustc_hir_analysis::check::wfcheck::check_well_formed
            37: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
            38: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_hir::hir_id::OwnerId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            39: rustc_query_impl::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
            40: rustc_hir_analysis::check::wfcheck::check_mod_type_wf
            41: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
            42: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalModDefId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            43: rustc_query_impl::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
            44: rustc_hir_analysis::check_crate
            45: rustc_interface::passes::analysis
            46: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
            47: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            48: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
            49: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            50: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            51: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/alloc/src/boxed.rs:2007:9
            52: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/alloc/src/boxed.rs:2007:9
            53: std::sys::unix::thread::Thread::new::thread_start
                       at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/std/src/sys/unix/thread.rs:108:17
            54: <unknown>
            55: <unknown>


error: internal compiler error: cannot relate consts of different types (a=13_usize, b=?0c: u64)
  |
  = note: delayed at compiler/rustc_infer/src/infer/combine.rs:178:31
             0: <rustc_errors::HandlerInner>::emit_diagnostic
             1: <rustc_session::session::Session>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
             2: <rustc_infer::infer::InferCtxt>::super_combine_consts::<rustc_infer::infer::equate::Equate>
             3: <rustc_infer::infer::InferCtxt>::super_combine_tys::<rustc_infer::infer::equate::Equate>
             4: <rustc_infer::infer::equate::Equate as rustc_middle::ty::relate::TypeRelation>::tys
             5: <rustc_trait_selection::traits::select::SelectionContext>::match_impl
             6: <rustc_trait_selection::traits::select::SelectionContext>::assemble_candidates_from_impls
             7: <rustc_trait_selection::traits::select::SelectionContext>::candidate_from_obligation_no_cache
             8: <rustc_trait_selection::traits::select::SelectionContext>::poly_select
             9: rustc_traits::codegen::codegen_select_candidate
            10: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::codegen_select_candidate::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 16]>>
            11: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<(rustc_middle::ty::ParamEnv, rustc_middle::ty::sty::TraitRef), rustc_middle::query::erase::Erased<[u8; 16]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            12: rustc_query_impl::query_impl::codegen_select_candidate::get_query_non_incr::__rust_end_short_backtrace
            13: rustc_ty_utils::instance::resolve_instance
            14: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::resolve_instance::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 32]>>
            15: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<(rustc_span::def_id::DefId, &rustc_middle::ty::list::List<rustc_middle::ty::generic_args::GenericArg>)>, rustc_middle::query::erase::Erased<[u8; 32]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            16: rustc_query_impl::query_impl::resolve_instance::get_query_non_incr::__rust_end_short_backtrace
            17: <rustc_middle::ty::context::TyCtxt>::const_eval_resolve
            18: <rustc_const_eval::interpret::eval_context::InterpCx<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>>::push_stack_frame
            19: rustc_const_eval::const_eval::eval_queries::eval_body_using_ecx
            20: rustc_const_eval::const_eval::eval_queries::eval_in_interpreter
            21: rustc_const_eval::const_eval::eval_queries::eval_to_allocation_raw_provider
            22: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 24]>>
            23: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            24: rustc_query_impl::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
            25: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
            26: rustc_const_eval::const_eval::eval_to_valtree
            27: <rustc_const_eval::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>)>>::call_once
            28: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::eval_to_valtree::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 24]>>
            29: <rustc_query_impl::query_impl::eval_to_valtree::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>)>>::call_once
            30: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            31: rustc_query_impl::query_impl::eval_to_valtree::get_query_non_incr::__rust_end_short_backtrace
            32: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
            33: <rustc_middle::ty::context::TyCtxt>::const_eval_resolve_for_typeck
            34: <rustc_infer::infer::InferCtxt>::const_eval_resolve
            35: rustc_trait_selection::traits::const_evaluatable::is_const_evaluatable
            36: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
            37: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
            38: <rustc_trait_selection::traits::engine::ObligationCtxt>::assumed_wf_types
            39: rustc_hir_analysis::check::wfcheck::check_item_fn
            40: rustc_hir_analysis::check::wfcheck::check_well_formed
            41: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
            42: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_hir::hir_id::OwnerId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            43: rustc_query_impl::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
            44: rustc_hir_analysis::check::wfcheck::check_mod_type_wf
            45: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
            46: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalModDefId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            47: rustc_query_impl::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
            48: rustc_hir_analysis::check_crate
            49: rustc_interface::passes::analysis
            50: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
            51: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            52: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
            53: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            54: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            55: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/alloc/src/boxed.rs:2007:9
            56: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/alloc/src/boxed.rs:2007:9
            57: std::sys::unix::thread::Thread::new::thread_start
                       at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/std/src/sys/unix/thread.rs:108:17
            58: <unknown>
            59: <unknown>


error: internal compiler error: cannot relate consts of different types (a=13_usize, b=?0c: u64)
  |
  = note: delayed at compiler/rustc_infer/src/infer/combine.rs:178:31
             0: <rustc_errors::HandlerInner>::emit_diagnostic
             1: <rustc_session::session::Session>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
             2: <rustc_infer::infer::InferCtxt>::super_combine_consts::<rustc_infer::infer::equate::Equate>
             3: <rustc_infer::infer::InferCtxt>::super_combine_tys::<rustc_infer::infer::equate::Equate>
             4: <rustc_infer::infer::equate::Equate as rustc_middle::ty::relate::TypeRelation>::tys
             5: <rustc_trait_selection::traits::select::SelectionContext>::poly_select
             6: rustc_traits::codegen::codegen_select_candidate
             7: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::codegen_select_candidate::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 16]>>
             8: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<(rustc_middle::ty::ParamEnv, rustc_middle::ty::sty::TraitRef), rustc_middle::query::erase::Erased<[u8; 16]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
             9: rustc_query_impl::query_impl::codegen_select_candidate::get_query_non_incr::__rust_end_short_backtrace
            10: rustc_ty_utils::instance::resolve_instance
            11: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::resolve_instance::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 32]>>
            12: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<(rustc_span::def_id::DefId, &rustc_middle::ty::list::List<rustc_middle::ty::generic_args::GenericArg>)>, rustc_middle::query::erase::Erased<[u8; 32]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            13: rustc_query_impl::query_impl::resolve_instance::get_query_non_incr::__rust_end_short_backtrace
            14: <rustc_middle::ty::context::TyCtxt>::const_eval_resolve
            15: <rustc_const_eval::interpret::eval_context::InterpCx<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>>::push_stack_frame
            16: rustc_const_eval::const_eval::eval_queries::eval_body_using_ecx
            17: rustc_const_eval::const_eval::eval_queries::eval_in_interpreter
            18: rustc_const_eval::const_eval::eval_queries::eval_to_allocation_raw_provider
            19: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 24]>>
            20: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            21: rustc_query_impl::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
            22: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
            23: rustc_const_eval::const_eval::eval_to_valtree
            24: <rustc_const_eval::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>)>>::call_once
            25: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::eval_to_valtree::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 24]>>
            26: <rustc_query_impl::query_impl::eval_to_valtree::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>)>>::call_once
            27: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            28: rustc_query_impl::query_impl::eval_to_valtree::get_query_non_incr::__rust_end_short_backtrace
            29: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
            30: <rustc_middle::ty::context::TyCtxt>::const_eval_resolve_for_typeck
            31: <rustc_infer::infer::InferCtxt>::const_eval_resolve
            32: rustc_trait_selection::traits::const_evaluatable::is_const_evaluatable
            33: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
            34: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
            35: <rustc_trait_selection::traits::engine::ObligationCtxt>::assumed_wf_types
            36: rustc_hir_analysis::check::wfcheck::check_item_fn
            37: rustc_hir_analysis::check::wfcheck::check_well_formed
            38: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
            39: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_hir::hir_id::OwnerId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            40: rustc_query_impl::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
            41: rustc_hir_analysis::check::wfcheck::check_mod_type_wf
            42: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
            43: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalModDefId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            44: rustc_query_impl::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
            45: rustc_hir_analysis::check_crate
            46: rustc_interface::passes::analysis
            47: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
            48: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            49: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
            50: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            51: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            52: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/alloc/src/boxed.rs:2007:9
            53: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/alloc/src/boxed.rs:2007:9
            54: std::sys::unix::thread::Thread::new::thread_start
                       at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/std/src/sys/unix/thread.rs:108:17
            55: <unknown>
            56: <unknown>


error: internal compiler error: missing value for assoc item in impl
 --> /tmp/icemaker_global_tempdir.AkvkbMS0tX2B/rustc_testrunner_tmpdir_reporting.0eLdCN0k5jPW/mvce.rs:2:5
  |
2 |     const ASSOC: usize;
  |     ^^^^^^^^^^^^^^^^^^
  |
note: delayed at compiler/rustc_ty_utils/src/instance.rs:174:38
         0: <rustc_errors::HandlerInner>::emit_diagnostic
         1: <rustc_session::session::Session>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
         2: rustc_ty_utils::instance::resolve_instance
         3: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::resolve_instance::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 32]>>
         4: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<(rustc_span::def_id::DefId, &rustc_middle::ty::list::List<rustc_middle::ty::generic_args::GenericArg>)>, rustc_middle::query::erase::Erased<[u8; 32]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
         5: rustc_query_impl::query_impl::resolve_instance::get_query_non_incr::__rust_end_short_backtrace
         6: <rustc_middle::ty::context::TyCtxt>::const_eval_resolve
         7: <rustc_const_eval::interpret::eval_context::InterpCx<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>>::push_stack_frame
         8: rustc_const_eval::const_eval::eval_queries::eval_body_using_ecx
         9: rustc_const_eval::const_eval::eval_queries::eval_in_interpreter
        10: rustc_const_eval::const_eval::eval_queries::eval_to_allocation_raw_provider
        11: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 24]>>
        12: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        13: rustc_query_impl::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
        14: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
        15: rustc_const_eval::const_eval::eval_to_valtree
        16: <rustc_const_eval::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>)>>::call_once
        17: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::eval_to_valtree::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 24]>>
        18: <rustc_query_impl::query_impl::eval_to_valtree::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>)>>::call_once
        19: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        20: rustc_query_impl::query_impl::eval_to_valtree::get_query_non_incr::__rust_end_short_backtrace
        21: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
        22: <rustc_middle::ty::context::TyCtxt>::const_eval_resolve_for_typeck
        23: <rustc_infer::infer::InferCtxt>::const_eval_resolve
        24: rustc_trait_selection::traits::const_evaluatable::is_const_evaluatable
        25: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
        26: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
        27: <rustc_trait_selection::traits::engine::ObligationCtxt>::assumed_wf_types
        28: rustc_hir_analysis::check::wfcheck::check_item_fn
        29: rustc_hir_analysis::check::wfcheck::check_well_formed
        30: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
        31: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_hir::hir_id::OwnerId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        32: rustc_query_impl::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
        33: rustc_hir_analysis::check::wfcheck::check_mod_type_wf
        34: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
        35: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalModDefId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        36: rustc_query_impl::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
        37: rustc_hir_analysis::check_crate
        38: rustc_interface::passes::analysis
        39: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
        40: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        41: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        42: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
        43: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
        44: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/alloc/src/boxed.rs:2007:9
        45: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/alloc/src/boxed.rs:2007:9
        46: std::sys::unix::thread::Thread::new::thread_start
                   at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/std/src/sys/unix/thread.rs:108:17
        47: <unknown>
        48: <unknown>
 --> /tmp/icemaker_global_tempdir.AkvkbMS0tX2B/rustc_testrunner_tmpdir_reporting.0eLdCN0k5jPW/mvce.rs:2:5
  |
2 |     const ASSOC: usize;
  |     ^^^^^^^^^^^^^^^^^^

error: internal compiler error: `report_selection_error` did not emit an error
 --> /tmp/icemaker_global_tempdir.AkvkbMS0tX2B/rustc_testrunner_tmpdir_reporting.0eLdCN0k5jPW/mvce.rs:7:25
  |
7 | pub fn q_user() -> [u8; <[u8; 13] as Q>::ASSOC] {}
  |                         ^^^^^^^^^^^^^^^^^^^^^^
  |
note: delayed at compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs:358:22
         0: <rustc_errors::HandlerInner>::emit_diagnostic
         1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
         2: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::type_err_ctxt_ext::TypeErrCtxtExt>::report_selection_error
         3: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::type_err_ctxt_ext::InferCtxtPrivExt>::report_fulfillment_error
         4: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::type_err_ctxt_ext::TypeErrCtxtExt>::report_fulfillment_errors
         5: rustc_hir_analysis::check::wfcheck::check_item_fn
         6: rustc_hir_analysis::check::wfcheck::check_well_formed
         7: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
         8: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_hir::hir_id::OwnerId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
         9: rustc_query_impl::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
        10: rustc_hir_analysis::check::wfcheck::check_mod_type_wf
        11: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
        12: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalModDefId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        13: rustc_query_impl::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
        14: rustc_hir_analysis::check_crate
        15: rustc_interface::passes::analysis
        16: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
        17: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        18: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        19: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
        20: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
        21: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/alloc/src/boxed.rs:2007:9
        22: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/alloc/src/boxed.rs:2007:9
        23: std::sys::unix::thread::Thread::new::thread_start
                   at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/std/src/sys/unix/thread.rs:108:17
        24: <unknown>
        25: <unknown>
 --> /tmp/icemaker_global_tempdir.AkvkbMS0tX2B/rustc_testrunner_tmpdir_reporting.0eLdCN0k5jPW/mvce.rs:7:25
  |
7 | pub fn q_user() -> [u8; <[u8; 13] as Q>::ASSOC] {}
  |                         ^^^^^^^^^^^^^^^^^^^^^^

error: internal compiler error: expected fulfillment errors
  |
  = note: delayed at compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs:207:23
             0: <rustc_errors::HandlerInner>::emit_diagnostic
             1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
             2: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::type_err_ctxt_ext::TypeErrCtxtExt>::report_fulfillment_errors
             3: rustc_hir_analysis::check::wfcheck::check_item_fn
             4: rustc_hir_analysis::check::wfcheck::check_well_formed
             5: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
             6: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_hir::hir_id::OwnerId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
             7: rustc_query_impl::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
             8: rustc_hir_analysis::check::wfcheck::check_mod_type_wf
             9: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
            10: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalModDefId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            11: rustc_query_impl::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
            12: rustc_hir_analysis::check_crate
            13: rustc_interface::passes::analysis
            14: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
            15: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            16: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
            17: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            18: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            19: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/alloc/src/boxed.rs:2007:9
            20: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/alloc/src/boxed.rs:2007:9
            21: std::sys::unix::thread::Thread::new::thread_start
                       at /rustc/2e4e2a8f288f642cafcc41fff211955ceddc453d/library/std/src/sys/unix/thread.rs:108:17
            22: <unknown>
            23: <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: rustc 1.75.0-nightly (2e4e2a8f2 2023-10-25) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z crate-attr=feature(generic_const_exprs) -Z dump-mir-dir=dir

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 Oct 25, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 25, 2023
@matthiaskrgr
Copy link
Member Author

Regression in a56bd2b / #116849 cc @oli-obk

@oli-obk
Copy link
Contributor

oli-obk commented Oct 25, 2023

The output used to be

warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> <source>:1:12
  |
1 | #![feature(generic_const_exprs)]
  |            ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
  = note: `#[warn(incomplete_features)]` on by default

error[E0046]: not all trait items implemented, missing: `ASSOC`
 --> <source>:7:1
  |
4 |     const ASSOC: usize;
  |     ------------------ `ASSOC` from trait
...
7 | impl<const N: u64> Q for [u8; N] {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `ASSOC` in implementation

error[E0308]: mismatched types
 --> <source>:9:20
  |
9 | pub fn q_user() -> [u8; <[u8; 13] as Q>::ASSOC] {}
  |        ------      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `[u8; <[u8; 13] as Q>::ASSOC]`, found `()`
  |        |
  |        implicitly returns `()` as its body has no tail or `return` expression

error[E0308]: mismatched types
 --> <source>:7:31
  |
7 | impl<const N: u64> Q for [u8; N] {}
  |                               ^ expected `usize`, found `u64`

error: aborting due to 3 previous errors; 1 warning emitted

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

meaning we now don't get to typeck anymore, because the delay_span_bugs happen before typeck runs (so the diagnostics are emitted after the error types/constants get created). Due to the way we're now tracking errors, the existance of an ErrorGuaranteed makes the logic think an error has been emitted, when it has not -.-

@oli-obk
Copy link
Contributor

oli-obk commented Oct 25, 2023

Interestingly this only is a problem if there is no associated type on the impl...

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 25, 2023
@bors bors closed this as completed in 26a9e08 Oct 25, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Oct 25, 2023
Rollup merge of rust-lang#117159 - oli-obk:error_shenanigans, r=estebank

Work around the fact that `check_mod_type_wf` may spuriously return `ErrorGuaranteed`

Even if that error is only emitted by `check_mod_item_types`.

fixes rust-lang#117153

A cleaner refactoring would merge/chain these queries in ways that ensure we only actually get an `ErrorGuaranteed` if there was an error emitted.
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) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants