Skip to content

[ICE]: assumptions on binders: is not fully resolved #157731

@matthiaskrgr

Description

@matthiaskrgr

Code

//-Zassumptions-on-binders -Znext-solver=globally
#![feature(min_specialization)]
trait SpecFromIter<T> {
    fn f(&self);
}
impl<'a, T: 'a, I: Iterator<Item = &'a T>> SpecFromIter<T> for I {
    default fn f(&self) {}
}
impl<'a, T> SpecFromIter<T> for std::slice::Iter<'a, T> {
    fn f(&self) {}
}
fn main() {}

Meta

rustc --version --verbose:

rustc 1.98.0-nightly (beae78130 2026-06-09)
binary: rustc
commit-hash: beae781308e9ddef13074a03faf57ca2fac59a5b
commit-date: 2026-06-09
host: x86_64-unknown-linux-gnu
release: 1.98.0-nightly
LLVM version: 22.1.6

Error output

<output>
Backtrace

note: no errors encountered even though delayed bugs were created

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

error: internal compiler error: `['?0, T/#1, std::slice::Iter<'a/#0, T/#1>]` is not fully resolved
  |
  = note: delayed at /rustc-dev/beae781308e9ddef13074a03faf57ca2fac59a5b/compiler/rustc_infer/src/infer/mod.rs:1369:43
             0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
             1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
             2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
             3: <rustc_errors::DiagCtxtHandle>::delayed_bug::<alloc::string::String>
             4: rustc_hir_analysis::impl_wf_check::min_specialization::check_always_applicable
             5: rustc_hir_analysis::check::check::check_item_type
             6: rustc_hir_analysis::check::wfcheck::check_well_formed
             7: rustc_query_impl::query_impl::check_well_formed::invoke_provider_fn::__rust_begin_short_backtrace
             8: rustc_query_impl::execution::try_execute_query::<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::ErasedData<[u8; 1]>, rustc_middle::dep_graph::graph::DepNodeIndex>, false>
             9: rustc_query_impl::query_impl::check_well_formed::execute_query_non_incr::__rust_end_short_backtrace
            10: rustc_hir_analysis::check::wfcheck::check_type_wf
            11: rustc_query_impl::query_impl::check_type_wf::invoke_provider_fn::__rust_begin_short_backtrace
            12: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::SingleCache<rustc_middle::query::erase::ErasedData<[u8; 1]>>, false>
            13: rustc_query_impl::query_impl::check_type_wf::execute_query_non_incr::__rust_end_short_backtrace
            14: rustc_hir_analysis::check_crate
            15: rustc_interface::passes::analysis
            16: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::SingleCache<rustc_middle::query::erase::ErasedData<[u8; 0]>>, false>
            17: rustc_query_impl::query_impl::analysis::execute_query_non_incr::__rust_end_short_backtrace
            18: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
            19: std::sys::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<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
            20: <std::thread::lifecycle::spawn_unchecked<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            21: <std::sys::thread::unix::Thread>::new::thread_start
            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: please make sure that you have updated to the latest nightly

note: please attach the file at `/home/matthias/vcs/github/CRED/rustc-ice-2026-06-10T20_38_32-1674868.txt` to your bug report

note: rustc 1.98.0-nightly (beae78130 2026-06-09) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z assumptions-on-binders -Z next-solver=globally

query stack during panic:
end of query stack

Metadata

Metadata

Assignees

No one assigned

    Labels

    -Zassumptions-on-bindersUnstable option: `-Zassumptions-on-bindersC-bugCategory: This is a bug.F-min_specialization`#![feature(min_specialization)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions