rust-lang / rust-lang/rust

[ICE]: bound types encountered in structurally_relate_tys

Open
#154,537 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug F-non_lifetime_binders 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
#![feature(non_lifetime_binders)]
fn take() -> impl for<T> Fn() -> T {
    || 3
}

fn main() {}

Meta

rustc --version --verbose:

rustc 1.96.0-nightly (fb27476aa 2026-03-28)
binary: rustc
commit-hash: fb27476aaf1012f1f6ace6306f9b990e0d989c31
commit-date: 2026-03-28
host: x86_64-unknown-linux-gnu
release: 1.96.0-nightly
LLVM version: 22.1.2
Error output
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)]
  |            ^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
  = note: `#[warn(incomplete_features)]` on by default
Backtrace

thread 'rustc' (3393651) panicked at /rustc-dev/fb27476aaf1012f1f6ace6306f9b990e0d989c31/compiler/rustc_type_ir/src/relate.rs:346:13:
bound types encountered in structurally_relate_tys
stack backtrace:
   0:     0x7fcb071845ab - <<std[78f1e358c25996ef]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[cd88f6cf038557fb]::fmt::Display>::fmt
   1:     0x7fcb0782f608 - core[cd88f6cf038557fb]::fmt::write
   2:     0x7fcb0719b5b6 - <std[78f1e358c25996ef]::sys::stdio::unix::Stderr as std[78f1e358c25996ef]::io::Write>::write_fmt
   3:     0x7fcb0715a5b8 - std[78f1e358c25996ef]::panicking::default_hook::{closure#0}
   4:     0x7fcb071779b3 - std[78f1e358c25996ef]::panicking::default_hook
   5:     0x7fcb0617cb8c - std[78f1e358c25996ef]::panicking::update_hook::<alloc[5b34cacabfc0eb1b]::boxed::Box<rustc_driver_impl[e37ea5797c2c1a39]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7fcb07177c92 - std[78f1e358c25996ef]::panicking::panic_with_hook
   7:     0x7fcb0715a6aa - std[78f1e358c25996ef]::panicking::panic_handler::{closure#0}
   8:     0x7fcb071513a9 - std[78f1e358c25996ef]::sys::backtrace::__rust_end_short_backtrace::<std[78f1e358c25996ef]::panicking::panic_handler::{closure#0}, !>
   9:     0x7fcb0715c0dd - __rustc[b27ca4e69fe37a8]::rust_begin_unwind
  10:     0x7fcb042e6a2c - core[cd88f6cf038557fb]::panicking::panic_fmt
  11:     0x7fcb0788af81 - rustc_type_ir[fd280ca1c2e42b66]::relate::structurally_relate_tys::<rustc_middle[98a1695a658fa77e]::ty::context::TyCtxt, rustc_infer[8d84b0296f7e2798]::infer::relate::generalize::Generalizer>::{closure#0}
  12:     0x7fcb07881e3d - <rustc_infer[8d84b0296f7e2798]::infer::relate::generalize::Generalizer as rustc_type_ir[fd280ca1c2e42b66]::relate::TypeRelation<rustc_middle[98a1695a658fa77e]::ty::context::TyCtxt>>::tys::{closure#0}
  13:     0x7fcb0788a322 - rustc_type_ir[fd280ca1c2e42b66]::relate::structurally_relate_tys::<rustc_middle[98a1695a658fa77e]::ty::context::TyCtxt, rustc_infer[8d84b0296f7e2798]::infer::relate::generalize::Generalizer>::{closure#0}
  14:     0x7fcb07881e3d - <rustc_infer[8d84b0296f7e2798]::infer::relate::generalize::Generalizer as rustc_type_ir[fd280ca1c2e42b66]::relate::TypeRelation<rustc_middle[98a1695a658fa77e]::ty::context::TyCtxt>>::tys::{closure#0}
  15:     0x7fcb084d0f08 - <rustc_infer[8d84b0296f7e2798]::infer::InferCtxt>::instantiate_ty_var::<rustc_type_ir[fd280ca1c2e42b66]::relate::solver_relating::SolverRelating<rustc_infer[8d84b0296f7e2798]::infer::InferCtxt, rustc_middle[98a1695a658fa77e]::ty::context::TyCtxt>>
  16:     0x7fcb084d1c26 - <rustc_type_ir[fd280ca1c2e42b66]::relate::solver_relating::SolverRelating<rustc_infer[8d84b0296f7e2798]::infer::InferCtxt, rustc_middle[98a1695a658fa77e]::ty::context::TyCtxt> as rustc_type_ir[fd280ca1c2e42b66]::relate::TypeRelation<rustc_middle[98a1695a658fa77e]::ty::context::TyCtxt>>::tys
  17:     0x7fcb084d19f5 - <rustc_infer[8d84b0296f7e2798]::infer::InferCtxt as rustc_type_ir[fd280ca1c2e42b66]::relate::solver_relating::RelateExt>::relate::<rustc_middle[98a1695a658fa77e]::ty::Ty>
  18:     0x7fcb0798f34e - <rustc_hir_typeck[9e63f00e0269f555]::fn_ctxt::FnCtxt>::demand_eqtype_with_origin
  19:     0x7fcb086795e3 - <rustc_hir_typeck[9e63f00e0269f555]::fn_ctxt::FnCtxt>::check_expr_closure
  20:     0x7fcb079b6f61 - <rustc_hir_typeck[9e63f00e0269f555]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  21:     0x7fcb079a6d2c - <rustc_hir_typeck[9e63f00e0269f555]::fn_ctxt::FnCtxt>::check_expr_block
  22:     0x7fcb079b5e95 - <rustc_hir_typeck[9e63f00e0269f555]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  23:     0x7fcb07e7da28 - rustc_hir_typeck[9e63f00e0269f555]::check::check_fn
  24:     0x7fcb07eaeea5 - rustc_hir_typeck[9e63f00e0269f555]::typeck_with_inspect::{closure#0}
  25:     0x7fcb07eac0c4 - rustc_query_impl[86d49cf1f0d19028]::query_impl::typeck::invoke_provider_fn::__rust_begin_short_backtrace
  26:     0x7fcb078e16a6 - rustc_query_impl[86d49cf1f0d19028]::execution::try_execute_query::<rustc_data_structures[c577e586c38a8d20]::vec_cache::VecCache<rustc_span[d062e5c8b9463d68]::def_id::LocalDefId, rustc_middle[98a1695a658fa77e]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[98a1695a658fa77e]::dep_graph::graph::DepNodeIndex>, false>
  27:     0x7fcb078e1043 - rustc_query_impl[86d49cf1f0d19028]::query_impl::typeck::execute_query_non_incr::__rust_end_short_backtrace
  28:     0x7fcb0822da2a - rustc_mir_build[dbc34d4d29f799fa]::thir::pattern::check_match::check_match
  29:     0x7fcb0822ce87 - rustc_query_impl[86d49cf1f0d19028]::query_impl::check_match::invoke_provider_fn::__rust_begin_short_backtrace
  30:     0x7fcb0855ea24 - rustc_query_impl[86d49cf1f0d19028]::execution::try_execute_query::<rustc_data_structures[c577e586c38a8d20]::vec_cache::VecCache<rustc_span[d062e5c8b9463d68]::def_id::LocalDefId, rustc_middle[98a1695a658fa77e]::query::erase::ErasedData<[u8; 1usize]>, rustc_middle[98a1695a658fa77e]::dep_graph::graph::DepNodeIndex>, false>
  31:     0x7fcb0855e682 - rustc_query_impl[86d49cf1f0d19028]::query_impl::check_match::execute_query_non_incr::__rust_end_short_backtrace
  32:     0x7fcb08234d89 - rustc_mir_build[dbc34d4d29f799fa]::builder::build_mir_inner_impl
  33:     0x7fcb0780b2aa - rustc_mir_transform[1b0f767021f8a0c9]::mir_built
  34:     0x7fcb078e16a6 - rustc_query_impl[86d49cf1f0d19028]::execution::try_execute_query::<rustc_data_structures[c577e586c38a8d20]::vec_cache::VecCache<rustc_span[d062e5c8b9463d68]::def_id::LocalDefId, rustc_middle[98a1695a658fa77e]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[98a1695a658fa77e]::dep_graph::graph::DepNodeIndex>, false>
  35:     0x7fcb078e11c3 - rustc_query_impl[86d49cf1f0d19028]::query_impl::mir_built::execute_query_non_incr::__rust_end_short_backtrace
  36:     0x7fcb078124ef - rustc_mir_transform[1b0f767021f8a0c9]::ffi_unwind_calls::has_ffi_unwind_calls
  37:     0x7fcb07811f59 - rustc_query_impl[86d49cf1f0d19028]::query_impl::has_ffi_unwind_calls::invoke_provider_fn::__rust_begin_short_backtrace
  38:     0x7fcb0855ea24 - rustc_query_impl[86d49cf1f0d19028]::execution::try_execute_query::<rustc_data_structures[c577e586c38a8d20]::vec_cache::VecCache<rustc_span[d062e5c8b9463d68]::def_id::LocalDefId, rustc_middle[98a1695a658fa77e]::query::erase::ErasedData<[u8; 1usize]>, rustc_middle[98a1695a658fa77e]::dep_graph::graph::DepNodeIndex>, false>
  39:     0x7fcb0855e5f6 - rustc_query_impl[86d49cf1f0d19028]::query_impl::has_ffi_unwind_calls::execute_query_non_incr::__rust_end_short_backtrace
  40:     0x7fcb082b44ea - rustc_mir_transform[1b0f767021f8a0c9]::mir_promoted
  41:     0x7fcb082b4352 - rustc_query_impl[86d49cf1f0d19028]::query_impl::mir_promoted::invoke_provider_fn::__rust_begin_short_backtrace
  42:     0x7fcb080479f9 - rustc_query_impl[86d49cf1f0d19028]::execution::try_execute_query::<rustc_data_structures[c577e586c38a8d20]::vec_cache::VecCache<rustc_span[d062e5c8b9463d68]::def_id::LocalDefId, rustc_middle[98a1695a658fa77e]::query::erase::ErasedData<[u8; 16usize]>, rustc_middle[98a1695a658fa77e]::dep_graph::graph::DepNodeIndex>, false>
  43:     0x7fcb08047583 - rustc_query_impl[86d49cf1f0d19028]::query_impl::mir_promoted::execute_query_non_incr::__rust_end_short_backtrace
  44:     0x7fcb0857d2b3 - rustc_borrowck[6a38bbbe7896bc20]::mir_borrowck
  45:     0x7fcb0857d225 - rustc_query_impl[86d49cf1f0d19028]::query_impl::mir_borrowck::invoke_provider_fn::__rust_begin_short_backtrace
  46:     0x7fcb078e16a6 - rustc_query_impl[86d49cf1f0d19028]::execution::try_execute_query::<rustc_data_structures[c577e586c38a8d20]::vec_cache::VecCache<rustc_span[d062e5c8b9463d68]::def_id::LocalDefId, rustc_middle[98a1695a658fa77e]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[98a1695a658fa77e]::dep_graph::graph::DepNodeIndex>, false>
  47:     0x7fcb078decd5 - rustc_query_impl[86d49cf1f0d19028]::query_impl::mir_borrowck::execute_query_non_incr::__rust_end_short_backtrace
  48:     0x7fcb08a2da48 - rustc_hir_analysis[872333e2b5cbbb56]::collect::type_of::opaque::find_opaque_ty_constraints_for_rpit
  49:     0x7fcb08a2d71c - rustc_hir_analysis[872333e2b5cbbb56]::collect::type_of::type_of_opaque
  50:     0x7fcb0784ffca - rustc_query_impl[86d49cf1f0d19028]::execution::try_execute_query::<rustc_middle[98a1695a658fa77e]::query::caches::DefIdCache<rustc_middle[98a1695a658fa77e]::query::erase::ErasedData<[u8; 8usize]>>, false>
  51:     0x7fcb07da592a - rustc_query_impl[86d49cf1f0d19028]::query_impl::type_of_opaque::execute_query_non_incr::__rust_end_short_backtrace
  52:     0x7fcb07d9ac89 - rustc_hir_analysis[872333e2b5cbbb56]::collect::type_of::type_of
  53:     0x7fcb07b7e52a - rustc_query_impl[86d49cf1f0d19028]::query_impl::type_of::invoke_provider_fn::__rust_begin_short_backtrace
  54:     0x7fcb0784ffca - rustc_query_impl[86d49cf1f0d19028]::execution::try_execute_query::<rustc_middle[98a1695a658fa77e]::query::caches::DefIdCache<rustc_middle[98a1695a658fa77e]::query::erase::ErasedData<[u8; 8usize]>>, false>
  55:     0x7fcb0784fb50 - rustc_query_impl[86d49cf1f0d19028]::query_impl::type_of::execute_query_non_incr::__rust_end_short_backtrace
  56:     0x7fcb087b5650 - rustc_hir_analysis[872333e2b5cbbb56]::check::check::check_opaque
  57:     0x7fcb085682ee - rustc_hir_analysis[872333e2b5cbbb56]::check::check::check_item_type
  58:     0x7fcb0855f426 - rustc_hir_analysis[872333e2b5cbbb56]::check::wfcheck::check_well_formed
  59:     0x7fcb0855f407 - rustc_query_impl[86d49cf1f0d19028]::query_impl::check_well_formed::invoke_provider_fn::__rust_begin_short_backtrace
  60:     0x7fcb0855ea24 - rustc_query_impl[86d49cf1f0d19028]::execution::try_execute_query::<rustc_data_structures[c577e586c38a8d20]::vec_cache::VecCache<rustc_span[d062e5c8b9463d68]::def_id::LocalDefId, rustc_middle[98a1695a658fa77e]::query::erase::ErasedData<[u8; 1usize]>, rustc_middle[98a1695a658fa77e]::dep_graph::graph::DepNodeIndex>, false>
  61:     0x7fcb0855e7bb - rustc_query_impl[86d49cf1f0d19028]::query_impl::check_well_formed::execute_query_non_incr::__rust_end_short_backtrace
  62:     0x7fcb0855adf0 - rustc_hir_analysis[872333e2b5cbbb56]::check::wfcheck::check_type_wf
  63:     0x7fcb0855ac67 - rustc_query_impl[86d49cf1f0d19028]::query_impl::check_type_wf::invoke_provider_fn::__rust_begin_short_backtrace
  64:     0x7fcb08a19d50 - rustc_query_impl[86d49cf1f0d19028]::execution::try_execute_query::<rustc_middle[98a1695a658fa77e]::query::caches::SingleCache<rustc_middle[98a1695a658fa77e]::query::erase::ErasedData<[u8; 1usize]>>, false>
  65:     0x7fcb08a19a29 - rustc_query_impl[86d49cf1f0d19028]::query_impl::check_type_wf::execute_query_non_incr::__rust_end_short_backtrace
  66:     0x7fcb0793dfdb - rustc_hir_analysis[872333e2b5cbbb56]::check_crate
  67:     0x7fcb078ddda7 - rustc_interface[89f5b40f13318e16]::passes::analysis
  68:     0x7fcb08a1c4c9 - rustc_query_impl[86d49cf1f0d19028]::execution::try_execute_query::<rustc_middle[98a1695a658fa77e]::query::caches::SingleCache<rustc_middle[98a1695a658fa77e]::query::erase::ErasedData<[u8; 0usize]>>, false>
  69:     0x7fcb08a1c2a9 - rustc_query_impl[86d49cf1f0d19028]::query_impl::analysis::execute_query_non_incr::__rust_end_short_backtrace
  70:     0x7fcb089e27a2 - rustc_interface[89f5b40f13318e16]::interface::run_compiler::<(), rustc_driver_impl[e37ea5797c2c1a39]::run_compiler::{closure#0}>::{closure#1}
  71:     0x7fcb089cc1be - std[78f1e358c25996ef]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[89f5b40f13318e16]::util::run_in_thread_with_globals<rustc_interface[89f5b40f13318e16]::util::run_in_thread_pool_with_globals<rustc_interface[89f5b40f13318e16]::interface::run_compiler<(), rustc_driver_impl[e37ea5797c2c1a39]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  72:     0x7fcb089cca60 - <std[78f1e358c25996ef]::thread::lifecycle::spawn_unchecked<rustc_interface[89f5b40f13318e16]::util::run_in_thread_with_globals<rustc_interface[89f5b40f13318e16]::util::run_in_thread_pool_with_globals<rustc_interface[89f5b40f13318e16]::interface::run_compiler<(), rustc_driver_impl[e37ea5797c2c1a39]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[cd88f6cf038557fb]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  73:     0x7fcb089cd8ec - <std[78f1e358c25996ef]::sys::thread::unix::Thread>::new::thread_start
  74:     0x7fcb024a597a - <unknown>
  75:     0x7fcb025292bc - <unknown>
  76:                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-03-29T07_23_24-3393641.txt` to your bug report

note: rustc 1.96.0-nightly (fb27476aa 2026-03-28) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z next-solver=globally

query stack during panic:
#0 [typeck] type-checking `take`
#1 [check_match] match-checking `take`
#2 [mir_built] building MIR for `take`
#3 [has_ffi_unwind_calls] checking if `take` contains FFI-unwind calls
#4 [mir_promoted] promoting constants in MIR for `take`
#5 [mir_borrowck] borrow-checking `take`
#6 [type_of_opaque] computing type of opaque `take::{opaque#0}`
#7 [type_of] computing type of `take::{opaque#0}`
#8 [check_well_formed] checking that `take::{opaque#0}` is well-formed
#9 [check_type_wf] checking that types are well-formed
#10 [analysis] running analysis passes on crate `code`
end of query stack
warning: 1 warning emitted

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: {OpaqueTypeKey { def_id: DefId(0:4 ~ code[40cc]::take::{opaque#0}), args: [] }: ProvisionalHiddenType { span: code.rs:3:5: 3:9 (#0), ty: ?1t }}
  |
  = note: delayed at /rustc-dev/fb27476aaf1012f1f6ace6306f9b990e0d989c31/compiler/rustc_infer/src/infer/opaque_types/table.rs:127: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: core::ptr::drop_in_place::<rustc_infer::infer::InferCtxt>
             5: core::ptr::drop_in_place::<rustc_hir_typeck::typeck_root_ctxt::TypeckRootCtxt>
             6: rustc_hir_typeck::typeck_with_inspect::{closure#0}
             7: rustc_query_impl::query_impl::typeck::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; 8]>, rustc_middle::dep_graph::graph::DepNodeIndex>, false>
             9: rustc_query_impl::query_impl::typeck::execute_query_non_incr::__rust_end_short_backtrace
            10: rustc_mir_build::thir::pattern::check_match::check_match
            11: rustc_query_impl::query_impl::check_match::invoke_provider_fn::__rust_begin_short_backtrace
            12: 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>
            13: rustc_query_impl::query_impl::check_match::execute_query_non_incr::__rust_end_short_backtrace
            14: rustc_mir_build::builder::build_mir_inner_impl
            15: rustc_mir_transform::mir_built
            16: rustc_query_impl::execution::try_execute_query::<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::ErasedData<[u8; 8]>, rustc_middle::dep_graph::graph::DepNodeIndex>, false>
            17: rustc_query_impl::query_impl::mir_built::execute_query_non_incr::__rust_end_short_backtrace
            18: rustc_mir_transform::ffi_unwind_calls::has_ffi_unwind_calls
            19: rustc_query_impl::query_impl::has_ffi_unwind_calls::invoke_provider_fn::__rust_begin_short_backtrace
            20: 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>
            21: rustc_query_impl::query_impl::has_ffi_unwind_calls::execute_query_non_incr::__rust_end_short_backtrace
            22: rustc_mir_transform::mir_promoted
            23: rustc_query_impl::query_impl::mir_promoted::invoke_provider_fn::__rust_begin_short_backtrace
            24: rustc_query_impl::execution::try_execute_query::<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::ErasedData<[u8; 16]>, rustc_middle::dep_graph::graph::DepNodeIndex>, false>
            25: rustc_query_impl::query_impl::mir_promoted::execute_query_non_incr::__rust_end_short_backtrace
            26: rustc_borrowck::mir_borrowck
            27: rustc_query_impl::query_impl::mir_borrowck::invoke_provider_fn::__rust_begin_short_backtrace
            28: rustc_query_impl::execution::try_execute_query::<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::ErasedData<[u8; 8]>, rustc_middle::dep_graph::graph::DepNodeIndex>, false>
            29: rustc_query_impl::query_impl::mir_borrowck::execute_query_non_incr::__rust_end_short_backtrace
            30: rustc_hir_analysis::collect::type_of::opaque::find_opaque_ty_constraints_for_rpit
            31: rustc_hir_analysis::collect::type_of::type_of_opaque
            32: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::DefIdCache<rustc_middle::query::erase::ErasedData<[u8; 8]>>, false>
            33: rustc_query_impl::query_impl::type_of_opaque::execute_query_non_incr::__rust_end_short_backtrace
            34: rustc_hir_analysis::collect::type_of::type_of
            35: rustc_query_impl::query_impl::type_of::invoke_provider_fn::__rust_begin_short_backtrace
            36: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::DefIdCache<rustc_middle::query::erase::ErasedData<[u8; 8]>>, false>
            37: rustc_query_impl::query_impl::type_of::execute_query_non_incr::__rust_end_short_backtrace
            38: rustc_hir_analysis::check::check::check_opaque
            39: rustc_hir_analysis::check::check::check_item_type
            40: rustc_hir_analysis::check::wfcheck::check_well_formed
            41: rustc_query_impl::query_impl::check_well_formed::invoke_provider_fn::__rust_begin_short_backtrace
            42: 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>
            43: rustc_query_impl::query_impl::check_well_formed::execute_query_non_incr::__rust_end_short_backtrace
            44: rustc_hir_analysis::check::wfcheck::check_type_wf
            45: rustc_query_impl::query_impl::check_type_wf::invoke_provider_fn::__rust_begin_short_backtrace
            46: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::SingleCache<rustc_middle::query::erase::ErasedData<[u8; 1]>>, false>
            47: rustc_query_impl::query_impl::check_type_wf::execute_query_non_incr::__rust_end_short_backtrace
            48: rustc_hir_analysis::check_crate
            49: rustc_interface::passes::analysis
            50: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::SingleCache<rustc_middle::query::erase::ErasedData<[u8; 0]>>, false>
            51: rustc_query_impl::query_impl::analysis::execute_query_non_incr::__rust_end_short_backtrace
            52: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
            53: 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}, ()>
            54: <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}
            55: <std::sys::thread::unix::Thread>::new::thread_start
            56: <unknown>
            57: <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-03-29T07_23_24-3393641.txt` to your bug report

note: rustc 1.96.0-nightly (fb27476aa 2026-03-28) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z next-solver=globally

query stack during panic:
end of query stack

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimized example and the panic at compiler/rustc_type_ir/src/relate.rs:346, then trace structurally_relate_tys through Generalizer and the closure type-checking frames in the backtrace. Reproduce the ICE on the reported nightly and add regression coverage; done means this input no longer panics and receives the appropriate compiler result.

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
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.