[ICE]: assumptions on binders: `assertion failed: matches!(goals_certainty, Certainty::Yes)`
Open
Nobody has claimed this yet.
-Zassumptions-on-binders
C-bug
F-type_alias_impl_trait
I-ICE
needs-triage
T-compiler
WG-trait-system-refactor
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Code
//@compile-flags: -Znext-solver=globally --edition=2021 -Zassumptions-on-binders
#![feature(type_alias_impl_trait)]
type FooArg<'a> = &'a impl Iterator<Item = FooItem>;
type FooRet = impl Iterator<Item = FooItem>;
type FooItem = Box<dyn Fn(FooArg) -> FooRet>;
struct Bar;
impl Iterator for Bar {
type Item = FooItem;
fn next(&mut self) -> Option<Self::Item> {
todo!()
}
}
fn main() {}
Meta
rustc --version --verbose:
rustc 1.99.0-nightly (da86f4d07 2026-07-24)
binary: rustc
commit-hash: da86f4d0726be475afbbffe40cb2f65741c51ad3
commit-date: 2026-07-24
host: x86_64-unknown-linux-gnu
release: 1.99.0-nightly
LLVM version: 22.1.8
Error output
<output>
Backtrace
thread 'rustc' (72155) panicked at /rustc-dev/da86f4d0726be475afbbffe40cb2f65741c51ad3/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs:1449:25:
assertion failed: matches!(goals_certainty, Certainty::Yes)
stack backtrace:
0: 0x7f3c5c23a956 - <<std[4614d3538cc64bc6]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[9cde01f631c9b89d]::fmt::Display>::fmt
1: 0x7f3c5c80dd52 - core[9cde01f631c9b89d]::fmt::write
2: 0x7f3c5c24faac - <std[4614d3538cc64bc6]::sys::stdio::unix::Stderr as core[9cde01f631c9b89d]::io::write::Write>::write_fmt
3: 0x7f3c5c20c58a - std[4614d3538cc64bc6]::panicking::default_hook::{closure#0}
4: 0x7f3c5c22cff3 - std[4614d3538cc64bc6]::panicking::default_hook
5: 0x7f3c5b1aa91b - std[4614d3538cc64bc6]::panicking::update_hook::<alloc[8bb6ecabe8c35eca]::boxed::Box<rustc_driver_impl[edb36ef1619d9191]::install_ice_hook::{closure#1}>>::{closure#0}
6: 0x7f3c5c22d492 - std[4614d3538cc64bc6]::panicking::panic_with_hook
7: 0x7f3c5c20c674 - std[4614d3538cc64bc6]::panicking::panic_handler::{closure#0}
8: 0x7f3c5c202fd9 - std[4614d3538cc64bc6]::sys::backtrace::__rust_end_short_backtrace::<std[4614d3538cc64bc6]::panicking::panic_handler::{closure#0}, !>
9: 0x7f3c5c20df9d - __rustc[b6a9bdc199f3cce9]::rust_begin_unwind
10: 0x7f3c5903768c - core[9cde01f631c9b89d]::panicking::panic_fmt
11: 0x7f3c593c5562 - core[9cde01f631c9b89d]::panicking::panic
12: 0x7f3c5d5e2767 - <rustc_next_trait_solver[8e06346dd9ceb5d]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[9bdecf7dd2eccf75]::solve::delegate::SolverDelegate, rustc_middle[95ffed4308bd885e]::ty::context::TyCtxt>>::evaluate_added_goals_and_make_canonical_response::{closure#0}
13: 0x7f3c5d5d05ce - <rustc_next_trait_solver[8e06346dd9ceb5d]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[9bdecf7dd2eccf75]::solve::delegate::SolverDelegate, rustc_middle[95ffed4308bd885e]::ty::context::TyCtxt>>::assemble_and_evaluate_candidates::<rustc_type_ir[76ae2ce2a1e3588e]::predicate::NormalizesTo<rustc_middle[95ffed4308bd885e]::ty::context::TyCtxt>>
14: 0x7f3c5da49b87 - <rustc_next_trait_solver[8e06346dd9ceb5d]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[9bdecf7dd2eccf75]::solve::delegate::SolverDelegate> as rustc_type_ir[76ae2ce2a1e3588e]::search_graph::Delegate>::compute_goal::{closure#0}
15: 0x7f3c59e4ed4c - <rustc_type_ir[76ae2ce2a1e3588e]::search_graph::SearchGraph<rustc_next_trait_solver[8e06346dd9ceb5d]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[9bdecf7dd2eccf75]::solve::delegate::SolverDelegate>, rustc_middle[95ffed4308bd885e]::ty::context::TyCtxt>>::evaluate_goal::{closure#0}
16: 0x7f3c5da495aa - <rustc_next_trait_solver[8e06346dd9ceb5d]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[9bdecf7dd2eccf75]::solve::delegate::SolverDelegate> as rustc_type_ir[76ae2ce2a1e3588e]::search_graph::Delegate>::compute_goal::{closure#0}
17: 0x7f3c59e4ed4c - <rustc_type_ir[76ae2ce2a1e3588e]::search_graph::SearchGraph<rustc_next_trait_solver[8e06346dd9ceb5d]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[9bdecf7dd2eccf75]::solve::delegate::SolverDelegate>, rustc_middle[95ffed4308bd885e]::ty::context::TyCtxt>>::evaluate_goal::{closure#0}
18: 0x7f3c5d32ed39 - <rustc_next_trait_solver[8e06346dd9ceb5d]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[9bdecf7dd2eccf75]::solve::delegate::SolverDelegate, rustc_middle[95ffed4308bd885e]::ty::context::TyCtxt>>::evaluate_goal_no_fast_paths
19: 0x7f3c5d661da0 - <rustc_trait_selection[9bdecf7dd2eccf75]::solve::delegate::SolverDelegate as rustc_next_trait_solver[8e06346dd9ceb5d]::solve::eval_ctxt::SolverDelegateEvalExt>::evaluate_root_goal
20: 0x7f3c5d66196d - <rustc_next_trait_solver[8e06346dd9ceb5d]::normalize::NormalizationFolder<rustc_infer[5e0ad29554e2cafa]::infer::InferCtxt, rustc_middle[95ffed4308bd885e]::ty::context::TyCtxt, rustc_trait_selection[9bdecf7dd2eccf75]::solve::normalize::normalize_with_universes<rustc_type_ir[76ae2ce2a1e3588e]::ty_kind::FnSig<rustc_middle[95ffed4308bd885e]::ty::context::TyCtxt>>::{closure#0}>>::normalize_alias_term
21: 0x7f3c5d6635a1 - <rustc_next_trait_solver[8e06346dd9ceb5d]::normalize::NormalizationFolder<rustc_infer[5e0ad29554e2cafa]::infer::InferCtxt, rustc_middle[95ffed4308bd885e]::ty::context::TyCtxt, rustc_trait_selection[9bdecf7dd2eccf75]::solve::normalize::normalize_with_universes<rustc_middle[95ffed4308bd885e]::ty::predicate::Predicate>::{closure#0}> as rustc_type_ir[76ae2ce2a1e3588e]::fold::FallibleTypeFolder<rustc_middle[95ffed4308bd885e]::ty::context::TyCtxt>>::try_fold_ty::{closure#0}
22: 0x7f3c5d663e4d - <&rustc_middle[95ffed4308bd885e]::ty::list::RawList<(), rustc_middle[95ffed4308bd885e]::ty::generic_args::GenericArg> as rustc_type_ir[76ae2ce2a1e3588e]::fold::TypeFoldable<rustc_middle[95ffed4308bd885e]::ty::context::TyCtxt>>::try_fold_with::<rustc_next_trait_solver[8e06346dd9ceb5d]::normalize::NormalizationFolder<rustc_infer[5e0ad29554e2cafa]::infer::InferCtxt, rustc_middle[95ffed4308bd885e]::ty::context::TyCtxt, rustc_trait_selection[9bdecf7dd2eccf75]::solve::normalize::normalize_with_universes<rustc_middle[95ffed4308bd885e]::ty::predicate::Predicate>::{closure#0}>>
23: 0x7f3c5d662d8f - rustc_trait_selection[9bdecf7dd2eccf75]::solve::normalize::normalize_with_universes::<rustc_middle[95ffed4308bd885e]::ty::predicate::Predicate>
24: 0x7f3c5d5180af - rustc_hir_analysis[640c65828d0efaa4]::check::compare_impl_item::check_type_bounds
25: 0x7f3c5cf14f9b - rustc_hir_analysis[640c65828d0efaa4]::check::compare_impl_item::compare_impl_item
26: 0x7f3c5cf123dd - rustc_query_impl[2c4821f97c2126e]::query_impl::compare_impl_item::invoke_provider_fn::__rust_begin_short_backtrace
27: 0x7f3c5d6c2871 - rustc_query_impl[2c4821f97c2126e]::execution::try_execute_query::<rustc_data_structures[353073ebb2751e77]::vec_cache::VecCache<rustc_span[48c26318c8901c96]::def_id::LocalDefId, rustc_middle[95ffed4308bd885e]::query::erase::ErasedData<[u8; 1usize]>, rustc_middle[95ffed4308bd885e]::dep_graph::graph::DepNodeIndex>, false>
28: 0x7f3c5d6c230e - rustc_query_impl[2c4821f97c2126e]::query_impl::compare_impl_item::execute_query_non_incr::__rust_end_short_backtrace
29: 0x7f3c5d6c5bb3 - rustc_hir_analysis[640c65828d0efaa4]::check::check::check_item_type
30: 0x7f3c5d6c327a - rustc_hir_analysis[640c65828d0efaa4]::check::wfcheck::check_well_formed
31: 0x7f3c5d6c325b - rustc_query_impl[2c4821f97c2126e]::query_impl::check_well_formed::invoke_provider_fn::__rust_begin_short_backtrace
32: 0x7f3c5d6c2871 - rustc_query_impl[2c4821f97c2126e]::execution::try_execute_query::<rustc_data_structures[353073ebb2751e77]::vec_cache::VecCache<rustc_span[48c26318c8901c96]::def_id::LocalDefId, rustc_middle[95ffed4308bd885e]::query::erase::ErasedData<[u8; 1usize]>, rustc_middle[95ffed4308bd885e]::dep_graph::graph::DepNodeIndex>, false>
33: 0x7f3c5d6c2607 - rustc_query_impl[2c4821f97c2126e]::query_impl::check_well_formed::execute_query_non_incr::__rust_end_short_backtrace
34: 0x7f3c5d6befb4 - rustc_hir_analysis[640c65828d0efaa4]::check::wfcheck::check_type_wf
35: 0x7f3c5d6beead - rustc_query_impl[2c4821f97c2126e]::query_impl::check_type_wf::invoke_provider_fn::__rust_begin_short_backtrace
36: 0x7f3c5d9dcb92 - rustc_query_impl[2c4821f97c2126e]::execution::try_execute_query::<rustc_middle[95ffed4308bd885e]::query::caches::SingleCache<rustc_middle[95ffed4308bd885e]::query::erase::ErasedData<[u8; 1usize]>>, false>
37: 0x7f3c5d9dc977 - rustc_query_impl[2c4821f97c2126e]::query_impl::check_type_wf::execute_query_non_incr::__rust_end_short_backtrace
38: 0x7f3c5cede8e4 - rustc_hir_analysis[640c65828d0efaa4]::check_crate
39: 0x7f3c5ced884d - rustc_interface[7615e26fe726d3dc]::passes::analysis
40: 0x7f3c5d9dd987 - rustc_query_impl[2c4821f97c2126e]::execution::try_execute_query::<rustc_middle[95ffed4308bd885e]::query::caches::SingleCache<rustc_middle[95ffed4308bd885e]::query::erase::ErasedData<[u8; 0usize]>>, false>
41: 0x7f3c5d9dd669 - rustc_query_impl[2c4821f97c2126e]::query_impl::analysis::execute_query_non_incr::__rust_end_short_backtrace
42: 0x7f3c5d994355 - rustc_interface[7615e26fe726d3dc]::interface::run_compiler::<(), rustc_driver_impl[edb36ef1619d9191]::run_compiler::{closure#0}>::{closure#2}
43: 0x7f3c5d9eb424 - std[4614d3538cc64bc6]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[7615e26fe726d3dc]::util::run_in_thread_with_globals<rustc_interface[7615e26fe726d3dc]::util::run_in_thread_pool_with_globals<rustc_interface[7615e26fe726d3dc]::interface::run_compiler<(), rustc_driver_impl[edb36ef1619d9191]::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
44: 0x7f3c5d9eb1ed - <std[4614d3538cc64bc6]::thread::lifecycle::spawn_unchecked<rustc_interface[7615e26fe726d3dc]::util::run_in_thread_with_globals<rustc_interface[7615e26fe726d3dc]::util::run_in_thread_pool_with_globals<rustc_interface[7615e26fe726d3dc]::interface::run_compiler<(), rustc_driver_impl[edb36ef1619d9191]::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[9cde01f631c9b89d]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
45: 0x7f3c5d9ee986 - <std[4614d3538cc64bc6]::sys::thread::unix::Thread>::new::thread_start
46: 0x7f3c57097739 - <unknown>
47: 0x7f3c5711bedc - <unknown>
48: 0x0 - <unknown>
error: the compiler unexpectedly panicked. This is a bug
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-07-25T11_56_29-72145.txt` to your bug report
note: rustc 1.99.0-nightly (da86f4d07 2026-07-24) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z next-solver=globally -Z assumptions-on-binders
query stack during panic:
#0 [compare_impl_item] checking assoc item `<impl at code.rs:7:1: 7:22>::Item` is compatible with trait definition
#1 [check_well_formed] checking that `<impl at code.rs:7:1: 7:22>` is well-formed
#2 [check_type_wf] checking that types are well-formed
#3 [analysis] running analysis passes on crate `code`
end of query stack
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the supplied minimal example with -Znext-solver=globally and -Zassumptions-on-binders, then inspect compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs at the assertion and the compare_impl_item query in the backtrace. Trace how goals_certainty is produced during associated-item checking. Done means the example no longer triggers an internal compiler error and a regression test covers it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100