-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Open
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-non_lifetime_binders`#![feature(non_lifetime_binders)]``#![feature(non_lifetime_binders)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)The Rustc Trait System Refactor Initiative (-Znext-solver)
Description
auto-reduced (treereduce-rust):
//@compile-flags: -Znext-solver=globally
#![feature(non_lifetime_binders)]
fn auto_trait()
where
for<T> T: PartialEq + PartialOrd,
{
}
fn main() {
auto_trait();
}original:
#![feature(non_lifetime_binders)]
//~^ WARN the feature `non_lifetime_binders` is incomplete
fn auto_trait()
where
for<T> T: PartialEq + PartialOrd,
{}
fn main() {
auto_trait();
//~^ ERROR can't compare `T` with `T`
}Version information
rustc 1.95.0-nightly (621d76794 2026-01-18)
binary: rustc
commit-hash: 621d76794c76fc21c0a6151fbc090120e0230a91
commit-date: 2026-01-18
host: x86_64-unknown-linux-gnu
release: 1.95.0-nightly
LLVM version: 21.1.8
Possibly related line of code:
rust/compiler/rustc_next_trait_solver/src/canonical/mod.rs
Lines 237 to 249 in 621d767
| I: Interner, | |
| { | |
| assert_eq!(original_values.len(), var_values.len()); | |
| for (&orig, response) in iter::zip(original_values, var_values.var_values.iter()) { | |
| let goals = | |
| delegate.eq_structurally_relating_aliases(param_env, orig, response, span).unwrap(); | |
| assert!(goals.is_empty()); | |
| } | |
| } | |
| fn register_region_constraints<D, I>( | |
| delegate: &D, |
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Znext-solver=globally
Program output
warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
--> /tmp/icemaker_global_tempdir.3IUGRof7GXQ5/rustc_testrunner_tmpdir_reporting.g52Pd7aPZE8u/mvce.rs:1:12
|
1 | #![feature(non_lifetime_binders)]
| ^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
= note: `#[warn(incomplete_features)]` on by default
thread 'rustc' (1053219) panicked at /rustc-dev/621d76794c76fc21c0a6151fbc090120e0230a91/compiler/rustc_next_trait_solver/src/canonical/mod.rs:243:88:
called `Result::unwrap()` on an `Err` value: Mismatch
stack backtrace:
0: 0x7f1035c33fd3 - <<std[287527946f71f0bc]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[7477a31a1a34cc49]::fmt::Display>::fmt
1: 0x7f103620e2c8 - core[7477a31a1a34cc49]::fmt::write
2: 0x7f1035c4a9c6 - <std[287527946f71f0bc]::sys::stdio::unix::Stderr as std[287527946f71f0bc]::io::Write>::write_fmt
3: 0x7f1035c0a048 - std[287527946f71f0bc]::panicking::default_hook::{closure#0}
4: 0x7f1035c27703 - std[287527946f71f0bc]::panicking::default_hook
5: 0x7f1034bfbb8a - std[287527946f71f0bc]::panicking::update_hook::<alloc[979041e9952e771b]::boxed::Box<rustc_driver_impl[517260a07841a630]::install_ice_hook::{closure#1}>>::{closure#0}
6: 0x7f1035c279e2 - std[287527946f71f0bc]::panicking::panic_with_hook
7: 0x7f1035c0a108 - std[287527946f71f0bc]::panicking::panic_handler::{closure#0}
8: 0x7f1035c00dc9 - std[287527946f71f0bc]::sys::backtrace::__rust_end_short_backtrace::<std[287527946f71f0bc]::panicking::panic_handler::{closure#0}, !>
9: 0x7f1035c0bbdd - __rustc[5ec7081ce87b032f]::rust_begin_unwind
10: 0x7f103270cfbc - core[7477a31a1a34cc49]::panicking::panic_fmt
11: 0x7f10325c3312 - core[7477a31a1a34cc49]::result::unwrap_failed
12: 0x7f1036880bea - rustc_next_trait_solver[2bc6883c9be4be93]::canonical::unify_query_var_values::<rustc_trait_selection[9fee51d8a10a777c]::solve::delegate::SolverDelegate, rustc_middle[725063e074f29df]::ty::context::TyCtxt>
13: 0x7f10373c1959 - <rustc_trait_selection[9fee51d8a10a777c]::solve::inspect::analyse::InspectCandidate>::instantiate_nested_goals
14: 0x7f10373c3dcd - <rustc_trait_selection[9fee51d8a10a777c]::solve::fulfill::derive_errors::BestObligation as rustc_trait_selection[9fee51d8a10a777c]::solve::inspect::analyse::ProofTreeVisitor>::visit_goal
15: 0x7f10373c39f0 - <rustc_infer[5a785d1c27494969]::infer::InferCtxt as rustc_trait_selection[9fee51d8a10a777c]::solve::inspect::analyse::InferCtxtProofTreeExt>::visit_proof_tree_at_depth::<rustc_trait_selection[9fee51d8a10a777c]::solve::fulfill::derive_errors::BestObligation>
16: 0x7f10373c767b - rustc_trait_selection[9fee51d8a10a777c]::solve::fulfill::derive_errors::find_best_leaf_obligation
17: 0x7f10373c6cc1 - <rustc_trait_selection[9fee51d8a10a777c]::traits::FulfillmentError as rustc_infer[5a785d1c27494969]::traits::engine::FromSolverError<rustc_trait_selection[9fee51d8a10a777c]::solve::fulfill::NextSolverError>>::from_solver_error
18: 0x7f1036e2ab4b - <rustc_trait_selection[9fee51d8a10a777c]::solve::fulfill::FulfillmentCtxt<rustc_trait_selection[9fee51d8a10a777c]::traits::FulfillmentError> as rustc_infer[5a785d1c27494969]::traits::engine::TraitEngine<rustc_trait_selection[9fee51d8a10a777c]::traits::FulfillmentError>>::try_evaluate_obligations
19: 0x7f1036640222 - <rustc_hir_typeck[ed5453188701a25b]::fn_ctxt::FnCtxt>::check_expr_call
20: 0x7f10366199b0 - <rustc_hir_typeck[ed5453188701a25b]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
21: 0x7f1036614ac2 - <rustc_hir_typeck[ed5453188701a25b]::fn_ctxt::FnCtxt>::check_expr_block
22: 0x7f103661998b - <rustc_hir_typeck[ed5453188701a25b]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
23: 0x7f10365fa1a6 - rustc_hir_typeck[ed5453188701a25b]::check::check_fn
24: 0x7f1036fb3d33 - rustc_hir_typeck[ed5453188701a25b]::typeck_with_inspect::{closure#0}
25: 0x7f1036fb26b4 - rustc_query_impl[f20b8284200e680a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f20b8284200e680a]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[725063e074f29df]::query::erase::Erased<[u8; 8usize]>>
26: 0x7f103635522a - rustc_query_system[b7e73caa2c2ad9a]::query::plumbing::try_execute_query::<rustc_query_impl[f20b8284200e680a]::DynamicConfig<rustc_data_structures[e0d8483206daafa2]::vec_cache::VecCache<rustc_span[851f35e07e3c2dd4]::def_id::LocalDefId, rustc_middle[725063e074f29df]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[b7e73caa2c2ad9a]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[f20b8284200e680a]::plumbing::QueryCtxt, false>
27: 0x7f1036354b09 - rustc_query_impl[f20b8284200e680a]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
28: 0x7f1036d3fdb5 - <rustc_middle[725063e074f29df]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_hir_analysis[1a80394817eddfdd]::check_crate::{closure#2}>::{closure#0}
29: 0x7f1036d3f7c4 - rustc_hir_analysis[1a80394817eddfdd]::check_crate
30: 0x7f10363493db - rustc_interface[5c48368f5debe80d]::passes::analysis
31: 0x7f1036349035 - rustc_query_impl[f20b8284200e680a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f20b8284200e680a]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[725063e074f29df]::query::erase::Erased<[u8; 0usize]>>
32: 0x7f10373a4be3 - rustc_query_system[b7e73caa2c2ad9a]::query::plumbing::try_execute_query::<rustc_query_impl[f20b8284200e680a]::DynamicConfig<rustc_query_system[b7e73caa2c2ad9a]::query::caches::SingleCache<rustc_middle[725063e074f29df]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[f20b8284200e680a]::plumbing::QueryCtxt, false>
33: 0x7f10373a49ce - rustc_query_impl[f20b8284200e680a]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
34: 0x7f1037582c11 - <rustc_interface[5c48368f5debe80d]::passes::create_and_enter_global_ctxt<core[7477a31a1a34cc49]::option::Option<rustc_interface[5c48368f5debe80d]::queries::Linker>, rustc_driver_impl[517260a07841a630]::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core[7477a31a1a34cc49]::ops::function::FnOnce<(&rustc_session[eb79e6d3104f29ae]::session::Session, rustc_middle[725063e074f29df]::ty::context::CurrentGcx, alloc[979041e9952e771b]::sync::Arc<rustc_data_structures[e0d8483206daafa2]::jobserver::Proxy>, &std[287527946f71f0bc]::sync::once_lock::OnceLock<rustc_middle[725063e074f29df]::ty::context::GlobalCtxt>, &rustc_data_structures[e0d8483206daafa2]::sync::worker_local::WorkerLocal<rustc_middle[725063e074f29df]::arena::Arena>, &rustc_data_structures[e0d8483206daafa2]::sync::worker_local::WorkerLocal<rustc_hir[7eac7792dedc1861]::Arena>, rustc_driver_impl[517260a07841a630]::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
35: 0x7f10373f5d34 - rustc_interface[5c48368f5debe80d]::interface::run_compiler::<(), rustc_driver_impl[517260a07841a630]::run_compiler::{closure#0}>::{closure#1}
36: 0x7f103735aa3a - std[287527946f71f0bc]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[5c48368f5debe80d]::util::run_in_thread_with_globals<rustc_interface[5c48368f5debe80d]::util::run_in_thread_pool_with_globals<rustc_interface[5c48368f5debe80d]::interface::run_compiler<(), rustc_driver_impl[517260a07841a630]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
37: 0x7f103735a7fe - <std[287527946f71f0bc]::thread::lifecycle::spawn_unchecked<rustc_interface[5c48368f5debe80d]::util::run_in_thread_with_globals<rustc_interface[5c48368f5debe80d]::util::run_in_thread_pool_with_globals<rustc_interface[5c48368f5debe80d]::interface::run_compiler<(), rustc_driver_impl[517260a07841a630]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[7477a31a1a34cc49]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
38: 0x7f103735c5c4 - <std[287527946f71f0bc]::sys::thread::unix::Thread>::new::thread_start
39: 0x7f1030c9698b - <unknown>
40: 0x7f1030d1a9cc - <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: rustc 1.95.0-nightly (621d76794 2026-01-18) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z next-solver=globally -Z dump-mir-dir=dir
query stack during panic:
#0 [typeck] type-checking `main`
#1 [analysis] running analysis passes on crate `mvce`
end of query stack
warning: 1 warning emitted
@rustbot label +F-non_lifetime_binders +WG-trait-system-refactor
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-non_lifetime_binders`#![feature(non_lifetime_binders)]``#![feature(non_lifetime_binders)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)The Rustc Trait System Refactor Initiative (-Znext-solver)