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 value for assoc item in impl #120343

Closed
matthiaskrgr opened this issue Jan 25, 2024 · 1 comment · Fixed by #120558
Closed

ICE: missing value for assoc item in impl #120343

matthiaskrgr opened this issue Jan 25, 2024 · 1 comment · Fixed by #120558
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

auto-reduced (treereduce-rust):

trait ToUnit<'a> {
    type Unit;
}

impl<'a, T: Copy + ?Sized> ToUnit<'a> for *const T {}

trait Overlap<T> {}

type Assoc<'a, T> = <*const T as ToUnit<'a>>::Unit;

impl<T> Overlap<T> for T {}

impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}

original:

trait ToUnit<'a> {
    type Unit;
}

struct LocalTy;
impl<'a> ToUnit<'a> for *const LocalTy {}

impl<'a, T: Copy + ?Sized> ToUnit<'a> for *const T {}

trait Overlap<T> {}

type Assoc<'a, T> = <*const T as ToUnit<'a>>::Unit;

impl<T> Overlap<T> for T {}

impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T where for<'a> *const T: Overlap<T> {}

Version information

rustc 1.77.0-nightly (5bd5d214e 2024-01-25)
binary: rustc
commit-hash: 5bd5d214effd494f4bafb29b3a7a2f6c2070ca5c
commit-date: 2024-01-25
host: x86_64-unknown-linux-gnu
release: 1.77.0-nightly
LLVM version: 17.0.6

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc --crate-type=lib -Znext-solver=coherence

Program output

WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:18 ~ mvce[dd88]::{impl#2}::'a), 'a) })], def_id: DefId(0:5 ~ mvce[dd88]::ToUnit::Unit) })
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:18 ~ mvce[dd88]::{impl#2}::'a), 'a) })], def_id: DefId(0:5 ~ mvce[dd88]::ToUnit::Unit) })
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:18 ~ mvce[dd88]::{impl#2}::'a), 'a) })], def_id: DefId(0:5 ~ mvce[dd88]::ToUnit::Unit) })
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:18 ~ mvce[dd88]::{impl#2}::'a), 'a) })], def_id: DefId(0:5 ~ mvce[dd88]::ToUnit::Unit) })
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:18 ~ mvce[dd88]::{impl#2}::'a), 'a) })], def_id: DefId(0:5 ~ mvce[dd88]::ToUnit::Unit) })
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:18 ~ mvce[dd88]::{impl#2}::'a), 'a) })], def_id: DefId(0:5 ~ mvce[dd88]::ToUnit::Unit) })
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:18 ~ mvce[dd88]::{impl#2}::'a), 'a) })], def_id: DefId(0:5 ~ mvce[dd88]::ToUnit::Unit) })
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:18 ~ mvce[dd88]::{impl#2}::'a), 'a) })], def_id: DefId(0:5 ~ mvce[dd88]::ToUnit::Unit) })
note: no errors encountered even though `span_delayed_bug` issued

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

error: internal compiler error: missing value for assoc item in impl
 --> /tmp/icemaker_global_tempdir.M7BqUXYU3OH4/rustc_testrunner_tmpdir_reporting.XOmc9iO39P3N/mvce.rs:2:5
  |
2 |     type Unit;
  |     ^^^^^^^^^
  |
note: delayed at compiler/rustc_trait_selection/src/solve/normalizes_to/mod.rs:198:38
         0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
         1: <rustc_errors::DiagCtxt>::emit_diagnostic
         2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic_builder::EmissionGuarantee>::emit_producing_guarantee
         3: <rustc_middle::ty::NormalizesTo as rustc_trait_selection::solve::assembly::GoalKind>::consider_impl_candidate::{closure#0}::{closure#2}
         4: <rustc_middle::ty::NormalizesTo as rustc_trait_selection::solve::assembly::GoalKind>::consider_impl_candidate
         5: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::assemble_candidates_via_self_ty::<rustc_middle::ty::NormalizesTo>
         6: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>::{closure#3}
         7: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>
         8: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_goal
         9: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::try_evaluate_added_goals
        10: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::try_normalize_ty_recur
        11: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::try_normalize_term
        12: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>::{closure#3}
        13: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>
        14: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_goal
        15: <rustc_infer::infer::InferCtxt as rustc_trait_selection::solve::eval_ctxt::InferCtxtEvalExt>::evaluate_root_goal
        16: <rustc_trait_selection::solve::fulfill::FulfillmentCtxt as rustc_infer::traits::engine::TraitEngine>::select_where_possible
        17: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation
        18: rustc_trait_selection::traits::coherence::overlap
        19: <rustc_middle::traits::specialization_graph::Children as rustc_trait_selection::traits::specialize::specialization_graph::ChildrenExt>::insert
        20: <rustc_middle::traits::specialization_graph::Graph as rustc_trait_selection::traits::specialize::specialization_graph::GraphExt>::insert
        21: rustc_trait_selection::traits::specialize::specialization_graph_provider
        22: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::specialization_graph_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
        23: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        24: rustc_query_impl::query_impl::specialization_graph_of::get_query_non_incr::__rust_end_short_backtrace
        25: rustc_hir_analysis::coherence::coherent_trait
        26: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::coherent_trait::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
        27: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        28: rustc_query_impl::query_impl::coherent_trait::get_query_non_incr::__rust_end_short_backtrace
        29: rustc_hir_analysis::check_crate
        30: rustc_interface::passes::analysis
        31: 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]>>
        32: 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>
        33: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        34: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
        35: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
        36: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{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}
        37: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/5bd5d214effd494f4bafb29b3a7a2f6c2070ca5c/library/alloc/src/boxed.rs:2016:9
        38: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/5bd5d214effd494f4bafb29b3a7a2f6c2070ca5c/library/alloc/src/boxed.rs:2016:9
        39: std::sys::pal::unix::thread::Thread::new::thread_start
                   at /rustc/5bd5d214effd494f4bafb29b3a7a2f6c2070ca5c/library/std/src/sys/pal/unix/thread.rs:108:17
        40: <unknown>
        41: <unknown>
 --> /tmp/icemaker_global_tempdir.M7BqUXYU3OH4/rustc_testrunner_tmpdir_reporting.XOmc9iO39P3N/mvce.rs:2:5
  |
2 |     type Unit;
  |     ^^^^^^^^^

error: internal compiler error: missing value for assoc item in impl
 --> /tmp/icemaker_global_tempdir.M7BqUXYU3OH4/rustc_testrunner_tmpdir_reporting.XOmc9iO39P3N/mvce.rs:2:5
  |
2 |     type Unit;
  |     ^^^^^^^^^
  |
note: delayed at compiler/rustc_trait_selection/src/solve/normalizes_to/mod.rs:198:38
         0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
         1: <rustc_errors::DiagCtxt>::emit_diagnostic
         2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic_builder::EmissionGuarantee>::emit_producing_guarantee
         3: <rustc_middle::ty::NormalizesTo as rustc_trait_selection::solve::assembly::GoalKind>::consider_impl_candidate::{closure#0}::{closure#2}
         4: <rustc_middle::ty::NormalizesTo as rustc_trait_selection::solve::assembly::GoalKind>::consider_impl_candidate
         5: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::assemble_candidates_via_self_ty::<rustc_middle::ty::NormalizesTo>
         6: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>::{closure#3}
         7: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>
         8: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_goal
         9: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::try_evaluate_added_goals
        10: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::try_normalize_ty_recur
        11: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::try_normalize_term
        12: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>::{closure#3}
        13: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>
        14: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_goal
        15: <rustc_infer::infer::InferCtxt as rustc_trait_selection::solve::eval_ctxt::InferCtxtEvalExt>::evaluate_root_goal
        16: rustc_trait_selection::traits::coherence::overlap
        17: <rustc_middle::traits::specialization_graph::Children as rustc_trait_selection::traits::specialize::specialization_graph::ChildrenExt>::insert
        18: <rustc_middle::traits::specialization_graph::Graph as rustc_trait_selection::traits::specialize::specialization_graph::GraphExt>::insert
        19: rustc_trait_selection::traits::specialize::specialization_graph_provider
        20: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::specialization_graph_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
        21: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        22: rustc_query_impl::query_impl::specialization_graph_of::get_query_non_incr::__rust_end_short_backtrace
        23: rustc_hir_analysis::coherence::coherent_trait
        24: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::coherent_trait::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
        25: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        26: rustc_query_impl::query_impl::coherent_trait::get_query_non_incr::__rust_end_short_backtrace
        27: rustc_hir_analysis::check_crate
        28: rustc_interface::passes::analysis
        29: 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]>>
        30: 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>
        31: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        32: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
        33: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
        34: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{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}
        35: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/5bd5d214effd494f4bafb29b3a7a2f6c2070ca5c/library/alloc/src/boxed.rs:2016:9
        36: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/5bd5d214effd494f4bafb29b3a7a2f6c2070ca5c/library/alloc/src/boxed.rs:2016:9
        37: std::sys::pal::unix::thread::Thread::new::thread_start
                   at /rustc/5bd5d214effd494f4bafb29b3a7a2f6c2070ca5c/library/std/src/sys/pal/unix/thread.rs:108:17
        38: <unknown>
        39: <unknown>
 --> /tmp/icemaker_global_tempdir.M7BqUXYU3OH4/rustc_testrunner_tmpdir_reporting.XOmc9iO39P3N/mvce.rs:2:5
  |
2 |     type Unit;
  |     ^^^^^^^^^

error: internal compiler error: missing value for assoc item in impl
 --> /tmp/icemaker_global_tempdir.M7BqUXYU3OH4/rustc_testrunner_tmpdir_reporting.XOmc9iO39P3N/mvce.rs:2:5
  |
2 |     type Unit;
  |     ^^^^^^^^^
  |
note: delayed at compiler/rustc_trait_selection/src/solve/normalizes_to/mod.rs:198:38
         0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
         1: <rustc_errors::DiagCtxt>::emit_diagnostic
         2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic_builder::EmissionGuarantee>::emit_producing_guarantee
         3: <rustc_middle::ty::NormalizesTo as rustc_trait_selection::solve::assembly::GoalKind>::consider_impl_candidate::{closure#0}::{closure#2}
         4: <rustc_middle::ty::NormalizesTo as rustc_trait_selection::solve::assembly::GoalKind>::consider_impl_candidate
         5: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::assemble_candidates_via_self_ty::<rustc_middle::ty::NormalizesTo>
         6: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>::{closure#3}
         7: <rustc_trait_selection::solve::search_graph::SearchGraph>::with_new_goal::<<rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_canonical_goal::{closure#0}::{closure#0}::{closure#0}>
         8: <rustc_trait_selection::solve::eval_ctxt::EvalCtxt>::evaluate_goal
         9: <rustc_infer::infer::InferCtxt as rustc_trait_selection::solve::eval_ctxt::InferCtxtEvalExt>::evaluate_root_goal
        10: <rustc_trait_selection::traits::coherence::AmbiguityCausesVisitor as rustc_trait_selection::solve::inspect::analyse::ProofTreeVisitor>::visit_goal
        11: rustc_trait_selection::traits::coherence::overlap
        12: <rustc_middle::traits::specialization_graph::Children as rustc_trait_selection::traits::specialize::specialization_graph::ChildrenExt>::insert
        13: <rustc_middle::traits::specialization_graph::Graph as rustc_trait_selection::traits::specialize::specialization_graph::GraphExt>::insert
        14: rustc_trait_selection::traits::specialize::specialization_graph_provider
        15: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::specialization_graph_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
        16: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        17: rustc_query_impl::query_impl::specialization_graph_of::get_query_non_incr::__rust_end_short_backtrace
        18: rustc_hir_analysis::coherence::coherent_trait
        19: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::coherent_trait::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
        20: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        21: rustc_query_impl::query_impl::coherent_trait::get_query_non_incr::__rust_end_short_backtrace
        22: rustc_hir_analysis::check_crate
        23: rustc_interface::passes::analysis
        24: 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]>>
        25: 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>
        26: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        27: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
        28: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
        29: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{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}
        30: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/5bd5d214effd494f4bafb29b3a7a2f6c2070ca5c/library/alloc/src/boxed.rs:2016:9
        31: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/5bd5d214effd494f4bafb29b3a7a2f6c2070ca5c/library/alloc/src/boxed.rs:2016:9
        32: std::sys::pal::unix::thread::Thread::new::thread_start
                   at /rustc/5bd5d214effd494f4bafb29b3a7a2f6c2070ca5c/library/std/src/sys/pal/unix/thread.rs:108:17
        33: <unknown>
        34: <unknown>
 --> /tmp/icemaker_global_tempdir.M7BqUXYU3OH4/rustc_testrunner_tmpdir_reporting.XOmc9iO39P3N/mvce.rs:2:5
  |
2 |     type Unit;
  |     ^^^^^^^^^

error: internal compiler error[E0119]: conflicting implementations of trait `Overlap<for<'a> fn(&'a (), {type error})>` for type `for<'a> fn(&'a (), {type error})`
  --> /tmp/icemaker_global_tempdir.M7BqUXYU3OH4/rustc_testrunner_tmpdir_reporting.XOmc9iO39P3N/mvce.rs:13:1
   |
11 | impl<T> Overlap<T> for T {}
   | ------------------------ first implementation here
12 |
13 | impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a> fn(&'a (), {type error})`
   |
   = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
note: delayed at compiler/rustc_trait_selection/src/traits/specialize/mod.rs:451:41
         0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
         1: <rustc_errors::DiagCtxt>::emit_diagnostic
         2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic_builder::EmissionGuarantee>::emit_producing_guarantee
         3: rustc_trait_selection::traits::specialize::report_overlap_conflict
         4: rustc_trait_selection::traits::specialize::specialization_graph_provider
         5: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::specialization_graph_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
         6: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
         7: rustc_query_impl::query_impl::specialization_graph_of::get_query_non_incr::__rust_end_short_backtrace
         8: rustc_hir_analysis::coherence::coherent_trait
         9: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::coherent_trait::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::DefIdCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        11: rustc_query_impl::query_impl::coherent_trait::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: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
        18: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
        19: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{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}
        20: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/5bd5d214effd494f4bafb29b3a7a2f6c2070ca5c/library/alloc/src/boxed.rs:2016:9
        21: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/5bd5d214effd494f4bafb29b3a7a2f6c2070ca5c/library/alloc/src/boxed.rs:2016:9
        22: std::sys::pal::unix::thread::Thread::new::thread_start
                   at /rustc/5bd5d214effd494f4bafb29b3a7a2f6c2070ca5c/library/std/src/sys/pal/unix/thread.rs:108:17
        23: <unknown>
        24: <unknown>
  --> /tmp/icemaker_global_tempdir.M7BqUXYU3OH4/rustc_testrunner_tmpdir_reporting.XOmc9iO39P3N/mvce.rs:13:1
   |
13 | impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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.77.0-nightly (5bd5d214e 2024-01-25) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -Z next-solver=coherence -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 Jan 25, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 25, 2024
@matthiaskrgr
Copy link
Member Author

#119895 cc @oli-obk

@fmease fmease removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 25, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 4, 2024
…stebank

Stop bailing out from compilation just because there were incoherent traits

fixes rust-lang#120343

but also has a lot of "type annotations needed" fallout. Some are fixed in the second commit.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 4, 2024
…stebank

Stop bailing out from compilation just because there were incoherent traits

fixes rust-lang#120343

but also has a lot of "type annotations needed" fallout. Some are fixed in the second commit.
bors added a commit to rust-lang-ci/rust that referenced this issue Feb 7, 2024
…ebank

Stop bailing out from compilation just because there were incoherent traits

fixes rust-lang#120343

but also has a lot of "type annotations needed" fallout. Some are fixed in the second commit.
@bors bors closed this as completed in 870a01a Feb 8, 2024
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.

3 participants