Skip to content

[ICE]: assumptions on binders: None in compiler/rustc_type_ir/src/region_constraint.rs #157813

Description

@matthiaskrgr

Code

//@ compile-flags: -Zassumptions-on-binders  -Znext-solver=globally
#![feature(min_generic_const_args, inherent_associated_types, generic_const_items)]
struct Parent<'a> {
    a: &'a str,
}
impl<'a> Parent<'a> {
    type const CT<T: 'a >: usize= 0;
}
fn check/*<T>*/()
where
    [(); Parent::CT::<T>]:,
{
}

fn main() {}

Meta

rustc --version --verbose:

rustc 1.98.0-nightly (b30f3df3b 2026-06-11)
binary: rustc
commit-hash: b30f3df3ba3c4c9de2f58f1a75dd9500b79b3f8d
commit-date: 2026-06-11
host: x86_64-unknown-linux-gnu
release: 1.98.0-nightly
LLVM version: 22.1.6

Error output

error[E0425]: cannot find type `T` in this scope
  --> code.rs:10:23
   |
10 |     [(); Parent::CT::<T>]:,
   |                       ^ not found in this scope
   |
help: you might be missing a type parameter
   |
 8 | fn check<T>/*<T>*/()
   |         +++

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

warning: the feature `inherent_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
 --> code.rs:1:36
  |
1 | #![feature(min_generic_const_args, inherent_associated_types, generic_const_items)]
  |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information

warning: the feature `generic_const_items` is incomplete and may not be safe to use and/or cause compiler crashes
 --> code.rs:1:63
  |
1 | #![feature(min_generic_const_args, inherent_associated_types, generic_const_items)]
  |                                                               ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
Backtrace

thread 'rustc' (2636272) panicked at /rustc-dev/b30f3df3ba3c4c9de2f58f1a75dd9500b79b3f8d/compiler/rustc_type_ir/src/region_constraint.rs:1040:56:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:     0x7f15338b26b9 - <<std[ec07bf76f648f713]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[73ced7a9812f00d0]::fmt::Display>::fmt
   1:     0x7f1534012788 - core[73ced7a9812f00d0]::fmt::write
   2:     0x7f15338c88f6 - <std[ec07bf76f648f713]::sys::stdio::unix::Stderr as std[ec07bf76f648f713]::io::Write>::write_fmt
   3:     0x7f1533887ffe - std[ec07bf76f648f713]::panicking::default_hook::{closure#0}
   4:     0x7f15338a57c3 - std[ec07bf76f648f713]::panicking::default_hook
   5:     0x7f1532694a1c - std[ec07bf76f648f713]::panicking::update_hook::<alloc[9259629fdb5636ff]::boxed::Box<rustc_driver_impl[46a9899c007cfa3a]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7f15338a5aa2 - std[ec07bf76f648f713]::panicking::panic_with_hook
   7:     0x7f15338880f4 - std[ec07bf76f648f713]::panicking::panic_handler::{closure#0}
   8:     0x7f153387edc9 - std[ec07bf76f648f713]::sys::backtrace::__rust_end_short_backtrace::<std[ec07bf76f648f713]::panicking::panic_handler::{closure#0}, !>
   9:     0x7f1533889b2d - __rustc[677cb191fb83bdf4]::rust_begin_unwind
  10:     0x7f153033234c - core[73ced7a9812f00d0]::panicking::panic_fmt
  11:     0x7f15308fa7e2 - core[73ced7a9812f00d0]::panicking::panic
  12:     0x7f1530536879 - core[73ced7a9812f00d0]::option::unwrap_failed
  13:     0x7f153368fd5c - <rustc_type_ir[c8192aa35f70a39c]::region_constraint::MaxUniverse<rustc_infer[6c429008fa57eb58]::infer::InferCtxt> as rustc_type_ir[c8192aa35f70a39c]::visit::TypeVisitor<rustc_middle[10ab9c6324e04bae]::ty::context::TyCtxt>>::visit_region
  14:     0x7f153352fe7e - rustc_type_ir[c8192aa35f70a39c]::region_constraint::max_universe::<rustc_infer[6c429008fa57eb58]::infer::InferCtxt, rustc_middle[10ab9c6324e04bae]::ty::context::TyCtxt, rustc_middle[10ab9c6324e04bae]::ty::predicate::Clause>
  15:     0x7f1534ac6784 - <rustc_next_trait_solver[edeac20aaeec26a2]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[c88e6f7fe10260f2]::solve::delegate::SolverDelegate> as rustc_type_ir[c8192aa35f70a39c]::search_graph::Delegate>::compute_goal::{closure#0}
  16:     0x7f153051326c - <rustc_type_ir[c8192aa35f70a39c]::search_graph::SearchGraph<rustc_next_trait_solver[edeac20aaeec26a2]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[c88e6f7fe10260f2]::solve::delegate::SolverDelegate>, rustc_middle[10ab9c6324e04bae]::ty::context::TyCtxt>>::evaluate_goal::{closure#0}
  17:     0x7f1534ae77df - <rustc_next_trait_solver[edeac20aaeec26a2]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[c88e6f7fe10260f2]::solve::delegate::SolverDelegate, rustc_middle[10ab9c6324e04bae]::ty::context::TyCtxt>>::evaluate_goal_raw
  18:     0x7f1534ae7095 - <rustc_trait_selection[c88e6f7fe10260f2]::solve::delegate::SolverDelegate as rustc_next_trait_solver[edeac20aaeec26a2]::solve::eval_ctxt::SolverDelegateEvalExt>::evaluate_root_goal
  19:     0x7f1534adec17 - <rustc_trait_selection[c88e6f7fe10260f2]::solve::fulfill::FulfillmentCtxt<rustc_trait_selection[c88e6f7fe10260f2]::traits::FulfillmentError> as rustc_infer[6c429008fa57eb58]::traits::engine::TraitEngine<rustc_trait_selection[c88e6f7fe10260f2]::traits::FulfillmentError>>::try_evaluate_obligations
  20:     0x7f1534ade9df - <rustc_trait_selection[c88e6f7fe10260f2]::solve::fulfill::FulfillmentCtxt<rustc_trait_selection[c88e6f7fe10260f2]::traits::FulfillmentError> as rustc_infer[6c429008fa57eb58]::traits::engine::TraitEngine<rustc_trait_selection[c88e6f7fe10260f2]::traits::FulfillmentError>>::evaluate_obligations_error_on_ambiguity
  21:     0x7f15345a259d - rustc_hir_analysis[265ba7ec9a5697e0]::check::wfcheck::check_item_fn
  22:     0x7f1534ead350 - rustc_hir_analysis[265ba7ec9a5697e0]::check::check::check_item_type
  23:     0x7f1534ea7032 - rustc_hir_analysis[265ba7ec9a5697e0]::check::wfcheck::check_well_formed
  24:     0x7f1534ea7013 - rustc_query_impl[7e233c08362496ed]::query_impl::check_well_formed::invoke_provider_fn::__rust_begin_short_backtrace
  25:     0x7f1534ea65f2 - rustc_query_impl[7e233c08362496ed]::execution::try_execute_query::<rustc_data_structures[e974637fe4765caf]::vec_cache::VecCache<rustc_span[91fa11528f5cbdd5]::def_id::LocalDefId, rustc_middle[10ab9c6324e04bae]::query::erase::ErasedData<[u8; 1usize]>, rustc_middle[10ab9c6324e04bae]::dep_graph::graph::DepNodeIndex>, false>
  26:     0x7f1534ea6387 - rustc_query_impl[7e233c08362496ed]::query_impl::check_well_formed::execute_query_non_incr::__rust_end_short_backtrace
  27:     0x7f1534ea2e7f - rustc_hir_analysis[265ba7ec9a5697e0]::check::wfcheck::check_type_wf
  28:     0x7f1534ea2d93 - rustc_query_impl[7e233c08362496ed]::query_impl::check_type_wf::invoke_provider_fn::__rust_begin_short_backtrace
  29:     0x7f15351e568d - rustc_query_impl[7e233c08362496ed]::execution::try_execute_query::<rustc_middle[10ab9c6324e04bae]::query::caches::SingleCache<rustc_middle[10ab9c6324e04bae]::query::erase::ErasedData<[u8; 1usize]>>, false>
  30:     0x7f15351e5469 - rustc_query_impl[7e233c08362496ed]::query_impl::check_type_wf::execute_query_non_incr::__rust_end_short_backtrace
  31:     0x7f15347de41b - rustc_hir_analysis[265ba7ec9a5697e0]::check_crate
  32:     0x7f1534518faa - rustc_interface[850069774feb2868]::passes::analysis
  33:     0x7f15351e4ac6 - rustc_query_impl[7e233c08362496ed]::execution::try_execute_query::<rustc_middle[10ab9c6324e04bae]::query::caches::SingleCache<rustc_middle[10ab9c6324e04bae]::query::erase::ErasedData<[u8; 0usize]>>, false>
  34:     0x7f15351e47a9 - rustc_query_impl[7e233c08362496ed]::query_impl::analysis::execute_query_non_incr::__rust_end_short_backtrace
  35:     0x7f1535197a57 - rustc_interface[850069774feb2868]::interface::run_compiler::<(), rustc_driver_impl[46a9899c007cfa3a]::run_compiler::{closure#0}>::{closure#1}
  36:     0x7f15351d1e7a - std[ec07bf76f648f713]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[850069774feb2868]::util::run_in_thread_with_globals<rustc_interface[850069774feb2868]::util::run_in_thread_pool_with_globals<rustc_interface[850069774feb2868]::interface::run_compiler<(), rustc_driver_impl[46a9899c007cfa3a]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  37:     0x7f15351d1c2d - <std[ec07bf76f648f713]::thread::lifecycle::spawn_unchecked<rustc_interface[850069774feb2868]::util::run_in_thread_with_globals<rustc_interface[850069774feb2868]::util::run_in_thread_pool_with_globals<rustc_interface[850069774feb2868]::interface::run_compiler<(), rustc_driver_impl[46a9899c007cfa3a]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[73ced7a9812f00d0]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  38:     0x7f15351c80d0 - <std[ec07bf76f648f713]::sys::thread::unix::Thread>::new::thread_start
  39:     0x7f152e6981b9 - <unknown>
  40:     0x7f152e71d21c - <unknown>
  41:                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-06-12T13_36_52-2636262.txt` to your bug report

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

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

query stack during panic:
#0 [check_well_formed] checking that `check` is well-formed
#1 [check_type_wf] checking that types are well-formed
#2 [analysis] running analysis passes on crate `code`
end of query stack
error: aborting due to 1 previous error; 3 warnings emitted

For more information about this error, try `rustc --explain E0425`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    -Zassumptions-on-bindersUnstable option: `-Zassumptions-on-bindersC-bugCategory: This is a bug.F-generic_const_items`#![feature(generic_const_items)]`F-inherent_associated_types`#![feature(inherent_associated_types)]`F-min_generic_const_args`#![feature(min_generic_const_args)]`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)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions