Skip to content

[ICE]: Binder / Cond<UnevaluatedConst has parameters, but no args were provided in instantiate #152647

@matthiaskrgr

Description

@matthiaskrgr

snippet:

#![feature(generic_const_exprs)]
struct A<const B: str = 1, C>;

Version information

rustc 1.95.0-nightly (75b9d89c6 2026-02-15)
binary: rustc
commit-hash: 75b9d89c68a4a92758349272aa4e35a8eb7a6708
commit-date: 2026-02-15
host: x86_64-unknown-linux-gnu
release: 1.95.0-nightly
LLVM version: 22.1.0

Possibly related line of code:

A: SliceLike<Item = I::GenericArg>,
{
// Nothing to fold, so let's avoid visiting things and possibly re-hashing/equating
// them when interning. Perf testing found this to be a modest improvement.
// See: <https://github.com/rust-lang/rust/pull/142317>
if args.is_empty() {
assert!(
!self.value.has_param(),
"{:?} has parameters, but no args were provided in instantiate",
self.value,
);
return self.value;
}

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error: generic parameters with a default must be trailing
 --> /tmp/icemaker_global_tempdir.mtz6XpahAzYG/rustc_testrunner_tmpdir_reporting.4ms6QxzBEU83/mvce.rs:2:16
  |
2 | struct A<const B: str = 1, C>;
  |                ^

warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /tmp/icemaker_global_tempdir.mtz6XpahAzYG/rustc_testrunner_tmpdir_reporting.4ms6QxzBEU83/mvce.rs:1:12
  |
1 | #![feature(generic_const_exprs)]
  |            ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
  = note: `#[warn(incomplete_features)]` on by default

error[E0601]: `main` function not found in crate `mvce`
 --> /tmp/icemaker_global_tempdir.mtz6XpahAzYG/rustc_testrunner_tmpdir_reporting.4ms6QxzBEU83/mvce.rs:2:31
  |
2 | struct A<const B: str = 1, C>;
  |                               ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.mtz6XpahAzYG/rustc_testrunner_tmpdir_reporting.4ms6QxzBEU83/mvce.rs`

error[E0392]: type parameter `C` is never used
 --> /tmp/icemaker_global_tempdir.mtz6XpahAzYG/rustc_testrunner_tmpdir_reporting.4ms6QxzBEU83/mvce.rs:2:28
  |
2 | struct A<const B: str = 1, C>;
  |                            ^ unused type parameter
  |
  = help: consider removing `C`, referring to it in a field, or using a marker such as `PhantomData`
  = help: if you intended `C` to be a const parameter, use `const C: /* Type */` instead


thread 'rustc' (1592825) panicked at /rustc-dev/75b9d89c68a4a92758349272aa4e35a8eb7a6708/compiler/rustc_type_ir/src/binder.rs:658:13:
Binder { value: TraitPredicate(<C as std::marker::Sized>, polarity:Positive), bound_vars: [] } has parameters, but no args were provided in instantiate
stack backtrace:
   0:     0x7f34bbfc8a8b - <<std[2d1308c35637467a]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[59b75ac17867df2]::fmt::Display>::fmt
   1:     0x7f34bc6110e0 - core[59b75ac17867df2]::fmt::write
   2:     0x7f34bbfdfd06 - <std[2d1308c35637467a]::sys::stdio::unix::Stderr as std[2d1308c35637467a]::io::Write>::write_fmt
   3:     0x7f34bbf9eb38 - std[2d1308c35637467a]::panicking::default_hook::{closure#0}
   4:     0x7f34bbfbbef3 - std[2d1308c35637467a]::panicking::default_hook
   5:     0x7f34baf8b61f - std[2d1308c35637467a]::panicking::update_hook::<alloc[b4f9b4e27dddabf5]::boxed::Box<rustc_driver_impl[e294da4906e6dc96]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7f34bbfbc1d2 - std[2d1308c35637467a]::panicking::panic_with_hook
   7:     0x7f34bbf9ebf8 - std[2d1308c35637467a]::panicking::panic_handler::{closure#0}
   8:     0x7f34bbf93169 - std[2d1308c35637467a]::sys::backtrace::__rust_end_short_backtrace::<std[2d1308c35637467a]::panicking::panic_handler::{closure#0}, !>
   9:     0x7f34bbfa065d - __rustc[67c75c4a30db75ac]::rust_begin_unwind
  10:     0x7f34b8c7e82c - core[59b75ac17867df2]::panicking::panic_fmt
  11:     0x7f34bc624060 - <rustc_middle[8dc6b2453706b250]::ty::generics::GenericPredicates>::instantiate_into
  12:     0x7f34bca9f768 - <rustc_trait_selection[7209d9f87f187584]::traits::wf::WfPredicates>::nominal_obligations
  13:     0x7f34bcdb5a61 - <rustc_trait_selection[7209d9f87f187584]::traits::wf::WfPredicates as rustc_type_ir[3dd64892f5672681]::visit::TypeVisitor<rustc_middle[8dc6b2453706b250]::ty::context::TyCtxt>>::visit_const
  14:     0x7f34bce2d51e - <rustc_trait_selection[7209d9f87f187584]::traits::fulfill::FulfillProcessor as rustc_data_structures[7f8c3356a540b3ba]::obligation_forest::ObligationProcessor>::process_obligation
  15:     0x7f34bc606dc1 - <rustc_data_structures[7f8c3356a540b3ba]::obligation_forest::ObligationForest<rustc_trait_selection[7209d9f87f187584]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[7209d9f87f187584]::traits::fulfill::FulfillProcessor>
  16:     0x7f34bcffbd70 - <rustc_trait_selection[7209d9f87f187584]::traits::fulfill::FulfillmentContext<rustc_trait_selection[7209d9f87f187584]::traits::FulfillmentError> as rustc_infer[ec8996369bcd2b55]::traits::engine::TraitEngine<rustc_trait_selection[7209d9f87f187584]::traits::FulfillmentError>>::evaluate_obligations_error_on_ambiguity
  17:     0x7f34bcff12a8 - rustc_hir_analysis[36a26c3b0cea6ab9]::check::wfcheck::check_type_defn
  18:     0x7f34bcfd10ed - rustc_hir_analysis[36a26c3b0cea6ab9]::check::check::check_item_type
  19:     0x7f34bcfcd22e - rustc_hir_analysis[36a26c3b0cea6ab9]::check::wfcheck::check_well_formed
  20:     0x7f34bcfcd20f - rustc_query_impl[ae97bbfaef5cf938]::query_impl::check_well_formed::invoke_provider_fn::__rust_begin_short_backtrace
  21:     0x7f34bcfcca06 - rustc_query_impl[ae97bbfaef5cf938]::execution::try_execute_query::<rustc_data_structures[7f8c3356a540b3ba]::vec_cache::VecCache<rustc_span[d1cb45c887057336]::def_id::LocalDefId, rustc_middle[8dc6b2453706b250]::query::erase::ErasedData<[u8; 1usize]>, rustc_middle[8dc6b2453706b250]::dep_graph::graph::DepNodeIndex>, {rustc_query_impl[ae97bbfaef5cf938]::QueryFlags { is_anon: false, is_depth_limit: false, is_feedable: false }}, false>
  22:     0x7f34bcfcc782 - rustc_query_impl[ae97bbfaef5cf938]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
  23:     0x7f34bcfc9ce9 - rustc_hir_analysis[36a26c3b0cea6ab9]::check::wfcheck::check_type_wf
  24:     0x7f34bcfc9be9 - rustc_query_impl[ae97bbfaef5cf938]::query_impl::check_type_wf::invoke_provider_fn::__rust_begin_short_backtrace
  25:     0x7f34bd88a0d3 - rustc_query_impl[ae97bbfaef5cf938]::execution::try_execute_query::<rustc_middle[8dc6b2453706b250]::query::caches::SingleCache<rustc_middle[8dc6b2453706b250]::query::erase::ErasedData<[u8; 1usize]>>, {rustc_query_impl[ae97bbfaef5cf938]::QueryFlags { is_anon: false, is_depth_limit: false, is_feedable: false }}, false>
  26:     0x7f34bd889e8e - rustc_query_impl[ae97bbfaef5cf938]::query_impl::check_type_wf::get_query_non_incr::__rust_end_short_backtrace
  27:     0x7f34bd05a3f3 - rustc_hir_analysis[36a26c3b0cea6ab9]::check_crate
  28:     0x7f34bd05e4d3 - rustc_interface[14454cc610ccaaa5]::passes::analysis
  29:     0x7f34bd88b999 - rustc_query_impl[ae97bbfaef5cf938]::execution::try_execute_query::<rustc_middle[8dc6b2453706b250]::query::caches::SingleCache<rustc_middle[8dc6b2453706b250]::query::erase::ErasedData<[u8; 0usize]>>, {rustc_query_impl[ae97bbfaef5cf938]::QueryFlags { is_anon: false, is_depth_limit: false, is_feedable: false }}, false>
  30:     0x7f34bd88b6d4 - rustc_query_impl[ae97bbfaef5cf938]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  31:     0x7f34bd924867 - <rustc_interface[14454cc610ccaaa5]::passes::create_and_enter_global_ctxt<core[59b75ac17867df2]::option::Option<rustc_interface[14454cc610ccaaa5]::queries::Linker>, rustc_driver_impl[e294da4906e6dc96]::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core[59b75ac17867df2]::ops::function::FnOnce<(&rustc_session[df95067a6cb94e78]::session::Session, rustc_middle[8dc6b2453706b250]::ty::context::CurrentGcx, alloc[b4f9b4e27dddabf5]::sync::Arc<rustc_data_structures[7f8c3356a540b3ba]::jobserver::Proxy>, &std[2d1308c35637467a]::sync::once_lock::OnceLock<rustc_middle[8dc6b2453706b250]::ty::context::GlobalCtxt>, &rustc_data_structures[7f8c3356a540b3ba]::sync::worker_local::WorkerLocal<rustc_middle[8dc6b2453706b250]::arena::Arena>, &rustc_data_structures[7f8c3356a540b3ba]::sync::worker_local::WorkerLocal<rustc_hir[2ea25bfe832ed195]::Arena>, rustc_driver_impl[e294da4906e6dc96]::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  32:     0x7f34bd869337 - rustc_interface[14454cc610ccaaa5]::interface::run_compiler::<(), rustc_driver_impl[e294da4906e6dc96]::run_compiler::{closure#0}>::{closure#1}
  33:     0x7f34bd84c5fe - std[2d1308c35637467a]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[14454cc610ccaaa5]::util::run_in_thread_with_globals<rustc_interface[14454cc610ccaaa5]::util::run_in_thread_pool_with_globals<rustc_interface[14454cc610ccaaa5]::interface::run_compiler<(), rustc_driver_impl[e294da4906e6dc96]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  34:     0x7f34bd84cce0 - <std[2d1308c35637467a]::thread::lifecycle::spawn_unchecked<rustc_interface[14454cc610ccaaa5]::util::run_in_thread_with_globals<rustc_interface[14454cc610ccaaa5]::util::run_in_thread_pool_with_globals<rustc_interface[14454cc610ccaaa5]::interface::run_compiler<(), rustc_driver_impl[e294da4906e6dc96]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[59b75ac17867df2]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  35:     0x7f34bd84db6c - <std[2d1308c35637467a]::sys::thread::unix::Thread>::new::thread_start
  36:     0x7f34bf0d198b - <unknown>
  37:     0x7f34bf155a0c - <unknown>
  38:                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 (75b9d89c6 2026-02-15) running on x86_64-unknown-linux-gnu

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

Some errors have detailed explanations: E0392, E0601.
For more information about an error, try `rustc --explain E0392`.

@rustbot label +F-generic_const_exprs

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.F-generic_const_exprs`#![feature(generic_const_exprs)]`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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions