Skip to content

[ICE]: assumptions on binders: assertion failed: max_universe(infcx, constraint.clone()) < u #157778

@matthiaskrgr

Description

@matthiaskrgr

Code

//@ compile-flags: -Znext-solver=globally -Zassumptions-on-binders   --edition=2024
#![feature(non_lifetime_binders,unboxed_closures)]
trait Bar<'a> {
    type Ref
    where
        for<AsyncFn> AsyncFn: Fn<(),Output: 'a>;
}

fn main() {}

Meta

rustc --version --verbose:

rustc 1.98.0-nightly (485ec3fbc 2026-06-10)
binary: rustc
commit-hash: 485ec3fbcc12fa14ef6596dabb125ad710499c9e
commit-date: 2026-06-10
host: x86_64-unknown-linux-gnu
release: 1.98.0-nightly
LLVM version: 22.1.6

Error output


Backtrace

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


thread 'rustc' (2184986) panicked at /rustc-dev/485ec3fbcc12fa14ef6596dabb125ad710499c9e/compiler/rustc_type_ir/src/region_constraint.rs:657:13:
assertion failed: max_universe(infcx, constraint.clone()) < u
stack backtrace:
   0:     0x7fdbfc0ac6c9 - <<std[3e0755d7ee10f1c0]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[53a3f952d0a3e8e5]::fmt::Display>::fmt
   1:     0x7fdbfc817648 - core[53a3f952d0a3e8e5]::fmt::write
   2:     0x7fdbfc0c2756 - <std[3e0755d7ee10f1c0]::sys::stdio::unix::Stderr as std[3e0755d7ee10f1c0]::io::Write>::write_fmt
   3:     0x7fdbfc081e5e - std[3e0755d7ee10f1c0]::panicking::default_hook::{closure#0}
   4:     0x7fdbfc09f623 - std[3e0755d7ee10f1c0]::panicking::default_hook
   5:     0x7fdbfae8f031 - std[3e0755d7ee10f1c0]::panicking::update_hook::<alloc[a394d862aa68610c]::boxed::Box<rustc_driver_impl[61600b431d86695d]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7fdbfc09f902 - std[3e0755d7ee10f1c0]::panicking::panic_with_hook
   7:     0x7fdbfc081f54 - std[3e0755d7ee10f1c0]::panicking::panic_handler::{closure#0}
   8:     0x7fdbfc078c29 - std[3e0755d7ee10f1c0]::sys::backtrace::__rust_end_short_backtrace::<std[3e0755d7ee10f1c0]::panicking::panic_handler::{closure#0}, !>
   9:     0x7fdbfc08398d - __rustc[d07b71777c76ca6]::rust_begin_unwind
  10:     0x7fdbf8b31bec - core[53a3f952d0a3e8e5]::panicking::panic_fmt
  11:     0x7fdbf943ceb2 - core[53a3f952d0a3e8e5]::panicking::panic
  12:     0x7fdbfbd1bfdf - rustc_type_ir[4e08b533ed31ae3f]::region_constraint::pull_region_outlives_constraints_out_of_universe::<rustc_infer[13cc7dad91134d3]::infer::InferCtxt, rustc_middle[50c0d6b250d15545]::ty::context::TyCtxt>
  13:     0x7fdbfbd1bd3a - rustc_type_ir[4e08b533ed31ae3f]::region_constraint::pull_region_outlives_constraints_out_of_universe::<rustc_infer[13cc7dad91134d3]::infer::InferCtxt, rustc_middle[50c0d6b250d15545]::ty::context::TyCtxt>
  14:     0x7fdbfbd1ac1f - rustc_type_ir[4e08b533ed31ae3f]::region_constraint::eagerly_handle_placeholders_in_universe::<rustc_infer[13cc7dad91134d3]::infer::InferCtxt, rustc_middle[50c0d6b250d15545]::ty::context::TyCtxt>
  15:     0x7fdbfd11f937 - <rustc_next_trait_solver[7474f56787e62491]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[3655874cae0de3f5]::solve::delegate::SolverDelegate, rustc_middle[50c0d6b250d15545]::ty::context::TyCtxt>>::evaluate_added_goals_and_make_canonical_response::{closure#0}
  16:     0x7fdbfde95b2b - <rustc_next_trait_solver[7474f56787e62491]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[3655874cae0de3f5]::solve::delegate::SolverDelegate, rustc_middle[50c0d6b250d15545]::ty::context::TyCtxt>>::compute_type_outlives_goal
  17:     0x7fdbfd2d0db8 - <rustc_next_trait_solver[7474f56787e62491]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[3655874cae0de3f5]::solve::delegate::SolverDelegate> as rustc_type_ir[4e08b533ed31ae3f]::search_graph::Delegate>::compute_goal::{closure#0}
  18:     0x7fdbf8d12cfb - <rustc_type_ir[4e08b533ed31ae3f]::search_graph::SearchGraph<rustc_next_trait_solver[7474f56787e62491]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[3655874cae0de3f5]::solve::delegate::SolverDelegate>, rustc_middle[50c0d6b250d15545]::ty::context::TyCtxt>>::evaluate_goal::{closure#0}
  19:     0x7fdbfd2f279f - <rustc_next_trait_solver[7474f56787e62491]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[3655874cae0de3f5]::solve::delegate::SolverDelegate, rustc_middle[50c0d6b250d15545]::ty::context::TyCtxt>>::evaluate_goal_raw
  20:     0x7fdbfd2e2fcb - <rustc_next_trait_solver[7474f56787e62491]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[3655874cae0de3f5]::solve::delegate::SolverDelegate, rustc_middle[50c0d6b250d15545]::ty::context::TyCtxt>>::evaluate_added_goals_step
  21:     0x7fdbfd11da34 - <rustc_next_trait_solver[7474f56787e62491]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[3655874cae0de3f5]::solve::delegate::SolverDelegate, rustc_middle[50c0d6b250d15545]::ty::context::TyCtxt>>::evaluate_added_goals_and_make_canonical_response::{closure#0}
  22:     0x7fdbfd2cf93d - <rustc_next_trait_solver[7474f56787e62491]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[3655874cae0de3f5]::solve::delegate::SolverDelegate> as rustc_type_ir[4e08b533ed31ae3f]::search_graph::Delegate>::compute_goal::{closure#0}
  23:     0x7fdbf8d12cfb - <rustc_type_ir[4e08b533ed31ae3f]::search_graph::SearchGraph<rustc_next_trait_solver[7474f56787e62491]::solve::search_graph::SearchGraphDelegate<rustc_trait_selection[3655874cae0de3f5]::solve::delegate::SolverDelegate>, rustc_middle[50c0d6b250d15545]::ty::context::TyCtxt>>::evaluate_goal::{closure#0}
  24:     0x7fdbfd2f279f - <rustc_next_trait_solver[7474f56787e62491]::solve::eval_ctxt::EvalCtxt<rustc_trait_selection[3655874cae0de3f5]::solve::delegate::SolverDelegate, rustc_middle[50c0d6b250d15545]::ty::context::TyCtxt>>::evaluate_goal_raw
  25:     0x7fdbfd2f2055 - <rustc_trait_selection[3655874cae0de3f5]::solve::delegate::SolverDelegate as rustc_next_trait_solver[7474f56787e62491]::solve::eval_ctxt::SolverDelegateEvalExt>::evaluate_root_goal
  26:     0x7fdbfd2ead97 - <rustc_trait_selection[3655874cae0de3f5]::solve::fulfill::FulfillmentCtxt<rustc_trait_selection[3655874cae0de3f5]::traits::FulfillmentError> as rustc_infer[13cc7dad91134d3]::traits::engine::TraitEngine<rustc_trait_selection[3655874cae0de3f5]::traits::FulfillmentError>>::try_evaluate_obligations
  27:     0x7fdbfd2eab61 - <rustc_trait_selection[3655874cae0de3f5]::solve::fulfill::FulfillmentCtxt<rustc_trait_selection[3655874cae0de3f5]::traits::FulfillmentError> as rustc_infer[13cc7dad91134d3]::traits::engine::TraitEngine<rustc_trait_selection[3655874cae0de3f5]::traits::FulfillmentError>>::evaluate_obligations_error_on_ambiguity
  28:     0x7fdbfd1caa9d - rustc_hir_analysis[8d3cdd21889740d0]::check::wfcheck::enter_wf_checking_ctxt::<rustc_hir_analysis[8d3cdd21889740d0]::check::wfcheck::check_associated_item::{closure#0}>
  29:     0x7fdbfd002f00 - rustc_hir_analysis[8d3cdd21889740d0]::check::check::check_item_type
  30:     0x7fdbfcffbca6 - rustc_hir_analysis[8d3cdd21889740d0]::check::wfcheck::check_well_formed
  31:     0x7fdbfcffbc87 - rustc_query_impl[fe6d0954731ad3fa]::query_impl::check_well_formed::invoke_provider_fn::__rust_begin_short_backtrace
  32:     0x7fdbfcffb272 - rustc_query_impl[fe6d0954731ad3fa]::execution::try_execute_query::<rustc_data_structures[e395eede3e8835c3]::vec_cache::VecCache<rustc_span[59dee30aae84166]::def_id::LocalDefId, rustc_middle[50c0d6b250d15545]::query::erase::ErasedData<[u8; 1usize]>, rustc_middle[50c0d6b250d15545]::dep_graph::graph::DepNodeIndex>, false>
  33:     0x7fdbfcffb007 - rustc_query_impl[fe6d0954731ad3fa]::query_impl::check_well_formed::execute_query_non_incr::__rust_end_short_backtrace
  34:     0x7fdbfcff797f - rustc_hir_analysis[8d3cdd21889740d0]::check::wfcheck::check_type_wf
  35:     0x7fdbfcff7855 - rustc_query_impl[fe6d0954731ad3fa]::query_impl::check_type_wf::invoke_provider_fn::__rust_begin_short_backtrace
  36:     0x7fdbfda5f54d - rustc_query_impl[fe6d0954731ad3fa]::execution::try_execute_query::<rustc_middle[50c0d6b250d15545]::query::caches::SingleCache<rustc_middle[50c0d6b250d15545]::query::erase::ErasedData<[u8; 1usize]>>, false>
  37:     0x7fdbfda5f329 - rustc_query_impl[fe6d0954731ad3fa]::query_impl::check_type_wf::execute_query_non_incr::__rust_end_short_backtrace
  38:     0x7fdbfd01cb9b - rustc_hir_analysis[8d3cdd21889740d0]::check_crate
  39:     0x7fdbfcf059bf - rustc_interface[e1940d23c19151a4]::passes::analysis
  40:     0x7fdbfda61b06 - rustc_query_impl[fe6d0954731ad3fa]::execution::try_execute_query::<rustc_middle[50c0d6b250d15545]::query::caches::SingleCache<rustc_middle[50c0d6b250d15545]::query::erase::ErasedData<[u8; 0usize]>>, false>
  41:     0x7fdbfda617e9 - rustc_query_impl[fe6d0954731ad3fa]::query_impl::analysis::execute_query_non_incr::__rust_end_short_backtrace
  42:     0x7fdbfda1e55a - rustc_interface[e1940d23c19151a4]::interface::run_compiler::<(), rustc_driver_impl[61600b431d86695d]::run_compiler::{closure#0}>::{closure#1}
  43:     0x7fdbfda4e13a - std[3e0755d7ee10f1c0]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[e1940d23c19151a4]::util::run_in_thread_with_globals<rustc_interface[e1940d23c19151a4]::util::run_in_thread_pool_with_globals<rustc_interface[e1940d23c19151a4]::interface::run_compiler<(), rustc_driver_impl[61600b431d86695d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  44:     0x7fdbfda4deed - <std[3e0755d7ee10f1c0]::thread::lifecycle::spawn_unchecked<rustc_interface[e1940d23c19151a4]::util::run_in_thread_with_globals<rustc_interface[e1940d23c19151a4]::util::run_in_thread_pool_with_globals<rustc_interface[e1940d23c19151a4]::interface::run_compiler<(), rustc_driver_impl[61600b431d86695d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[53a3f952d0a3e8e5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  45:     0x7fdbfda44590 - <std[3e0755d7ee10f1c0]::sys::thread::unix::Thread>::new::thread_start
  46:     0x7fdbf6e981b9 - <unknown>
  47:     0x7fdbf6f1d21c - <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-06-11T15_48_19-2184976.txt` to your bug report

note: rustc 1.98.0-nightly (485ec3fbc 2026-06-10) running on x86_64-unknown-linux-gnu

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

query stack during panic:
#0 [check_well_formed] checking that `Bar::Ref` 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
warning: 1 warning emitted

Metadata

Metadata

Assignees

No one assigned

    Labels

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