rust-lang / rust-lang/rust

ICE: `.. has parameters, but no args were provided in instantiate`

Open
#143,205 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug F-generic_const_exprs I-ICE P-low T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

original:

#![feature(generic_const_exprs)]

struct Bug<A = [(); (1).1]> {
    a: Bug,
}

pub fn main() {}

Version information

rustc 1.90.0-nightly (5e749eb66 2025-06-29)
binary: rustc
commit-hash: 5e749eb66f93ee998145399fbdde337e57cd72ef
commit-date: 2025-06-29
host: x86_64-unknown-linux-gnu
release: 1.90.0-nightly
LLVM version: 20.1.7

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

Program output

warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /tmp/icemaker_global_tempdir.Fb3BvTkGRo8F/rustc_testrunner_tmpdir_reporting.Gdd5CFRjApdq/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

thread 'rustc' panicked at /rustc-dev/5e749eb66f93ee998145399fbdde337e57cd72ef/compiler/rustc_type_ir/src/binder.rs:629:13:
[(); UnevaluatedConst { def: DefId(0:5 ~ mvce[e0ba]::Bug::{constant#0}), args: [A/#0] }] has parameters, but no args were provided in instantiate
stack backtrace:
   0:     0x74e3206bf0f3 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hf8c83fca91c0c9aa
   1:     0x74e320e02c3f - core::fmt::write::hcc50d62c90a1c130
   2:     0x74e3206b4d33 - std::io::Write::write_fmt::h6758bbbbf072075a
   3:     0x74e3206bef52 - std::sys::backtrace::BacktraceLock::print::h3c9a046a87f65356
   4:     0x74e3206c2a4a - std::panicking::default_hook::{{closure}}::h552f765289238e34
   5:     0x74e3206c25cf - std::panicking::default_hook::hd51b3d6d4a422ba4
   6:     0x74e31f789fd3 - std[3b75cbde80eecb9]::panicking::update_hook::<alloc[59682b47e8658ddc]::boxed::Box<rustc_driver_impl[66c5506b25ac6c22]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x74e3206c329b - std::panicking::rust_panic_with_hook::hfbfa6b41c6606fd5
   8:     0x74e3206c2f9a - std::panicking::begin_panic_handler::{{closure}}::hf4572da4f47b8abf
   9:     0x74e3206bf5b9 - std::sys::backtrace::__rust_end_short_backtrace::h6bf114b84a177707
  10:     0x74e3206c2c7d - __rustc[cbed8a541fb6a70f]::rust_begin_unwind
  11:     0x74e31cea4f40 - core::panicking::panic_fmt::h6ab9c7958b8b714e
  12:     0x74e322a03938 - <<dyn rustc_hir_analysis[5296667c4f1d37fa]::hir_ty_lowering::HirTyLowerer>::lower_generic_args_of_path::{closure#0}::GenericArgsCtxt as rustc_hir_analysis[5296667c4f1d37fa]::hir_ty_lowering::GenericArgsLowerer>::inferred_kind.cold
  13:     0x74e3216bc7b7 - <dyn rustc_hir_analysis[5296667c4f1d37fa]::hir_ty_lowering::HirTyLowerer>::lower_resolved_ty_path
  14:     0x74e3216b8816 - <dyn rustc_hir_analysis[5296667c4f1d37fa]::hir_ty_lowering::HirTyLowerer>::lower_ty
  15:     0x74e3216a22ef - rustc_hir_analysis[5296667c4f1d37fa]::collect::type_of::type_of
  16:     0x74e320e4bd24 - rustc_query_impl[a69fa6c174b96b79]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a69fa6c174b96b79]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3380c2e4ab1b787e]::query::erase::Erased<[u8; 8usize]>>
  17:     0x74e320e4a7a5 - rustc_query_system[6275b40e06d9ab29]::query::plumbing::try_execute_query::<rustc_query_impl[a69fa6c174b96b79]::DynamicConfig<rustc_query_system[6275b40e06d9ab29]::query::caches::DefIdCache<rustc_middle[3380c2e4ab1b787e]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[a69fa6c174b96b79]::plumbing::QueryCtxt, false>
  18:     0x74e320e4a35d - rustc_query_impl[a69fa6c174b96b79]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  19:     0x74e321ca6da4 - rustc_hir_analysis[5296667c4f1d37fa]::outlives::inferred_outlives_crate
  20:     0x74e321f67df0 - rustc_query_impl[a69fa6c174b96b79]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a69fa6c174b96b79]::query_impl::inferred_outlives_crate::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3380c2e4ab1b787e]::query::erase::Erased<[u8; 8usize]>>
  21:     0x74e321e803c1 - rustc_query_system[6275b40e06d9ab29]::query::plumbing::try_execute_query::<rustc_query_impl[a69fa6c174b96b79]::DynamicConfig<rustc_query_system[6275b40e06d9ab29]::query::caches::SingleCache<rustc_middle[3380c2e4ab1b787e]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[a69fa6c174b96b79]::plumbing::QueryCtxt, false>
  22:     0x74e321e7f0de - rustc_query_impl[a69fa6c174b96b79]::query_impl::inferred_outlives_crate::get_query_non_incr::__rust_end_short_backtrace
  23:     0x74e320f80264 - rustc_query_impl[a69fa6c174b96b79]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a69fa6c174b96b79]::query_impl::inferred_outlives_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3380c2e4ab1b787e]::query::erase::Erased<[u8; 16usize]>>
  24:     0x74e320f7f070 - rustc_query_system[6275b40e06d9ab29]::query::plumbing::try_execute_query::<rustc_query_impl[a69fa6c174b96b79]::DynamicConfig<rustc_query_system[6275b40e06d9ab29]::query::caches::DefIdCache<rustc_middle[3380c2e4ab1b787e]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[a69fa6c174b96b79]::plumbing::QueryCtxt, false>
  25:     0x74e320f7eabe - rustc_query_impl[a69fa6c174b96b79]::query_impl::inferred_outlives_of::get_query_non_incr::__rust_end_short_backtrace
  26:     0x74e320f87f22 - rustc_query_impl[a69fa6c174b96b79]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a69fa6c174b96b79]::query_impl::predicates_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3380c2e4ab1b787e]::query::erase::Erased<[u8; 24usize]>>
  27:     0x74e320f89185 - rustc_query_system[6275b40e06d9ab29]::query::plumbing::try_execute_query::<rustc_query_impl[a69fa6c174b96b79]::DynamicConfig<rustc_query_system[6275b40e06d9ab29]::query::caches::DefIdCache<rustc_middle[3380c2e4ab1b787e]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[a69fa6c174b96b79]::plumbing::QueryCtxt, false>
  28:     0x74e320f889a2 - rustc_query_impl[a69fa6c174b96b79]::query_impl::predicates_of::get_query_non_incr::__rust_end_short_backtrace
  29:     0x74e32165fd14 - rustc_hir_analysis[5296667c4f1d37fa]::check::wfcheck::check_item
  30:     0x74e321657fd9 - rustc_hir_analysis[5296667c4f1d37fa]::check::wfcheck::check_well_formed
  31:     0x74e321657e59 - rustc_query_impl[a69fa6c174b96b79]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a69fa6c174b96b79]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3380c2e4ab1b787e]::query::erase::Erased<[u8; 1usize]>>
  32:     0x74e32165768d - rustc_query_system[6275b40e06d9ab29]::query::plumbing::try_execute_query::<rustc_query_impl[a69fa6c174b96b79]::DynamicConfig<rustc_data_structures[5e9e44c3aae709fe]::vec_cache::VecCache<rustc_span[6f17e5f6adccd11a]::def_id::LocalDefId, rustc_middle[3380c2e4ab1b787e]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[6275b40e06d9ab29]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[a69fa6c174b96b79]::plumbing::QueryCtxt, false>
  33:     0x74e3216571c2 - rustc_query_impl[a69fa6c174b96b79]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
  34:     0x74e32165491f - rustc_hir_analysis[5296667c4f1d37fa]::check::wfcheck::check_type_wf
  35:     0x74e32165481d - rustc_query_impl[a69fa6c174b96b79]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a69fa6c174b96b79]::query_impl::check_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3380c2e4ab1b787e]::query::erase::Erased<[u8; 1usize]>>
  36:     0x74e321e7ccb0 - rustc_query_system[6275b40e06d9ab29]::query::plumbing::try_execute_query::<rustc_query_impl[a69fa6c174b96b79]::DynamicConfig<rustc_query_system[6275b40e06d9ab29]::query::caches::SingleCache<rustc_middle[3380c2e4ab1b787e]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[a69fa6c174b96b79]::plumbing::QueryCtxt, false>
  37:     0x74e321e7ca8e - rustc_query_impl[a69fa6c174b96b79]::query_impl::check_type_wf::get_query_non_incr::__rust_end_short_backtrace
  38:     0x74e32106a6ba - rustc_hir_analysis[5296667c4f1d37fa]::check_crate
  39:     0x74e32106f2e7 - rustc_interface[a50dc9db8085a4ed]::passes::analysis
  40:     0x74e32106ef0b - rustc_query_impl[a69fa6c174b96b79]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a69fa6c174b96b79]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3380c2e4ab1b787e]::query::erase::Erased<[u8; 0usize]>>
  41:     0x74e321e7e3fc - rustc_query_system[6275b40e06d9ab29]::query::plumbing::try_execute_query::<rustc_query_impl[a69fa6c174b96b79]::DynamicConfig<rustc_query_system[6275b40e06d9ab29]::query::caches::SingleCache<rustc_middle[3380c2e4ab1b787e]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[a69fa6c174b96b79]::plumbing::QueryCtxt, false>
  42:     0x74e321e7e0d2 - rustc_query_impl[a69fa6c174b96b79]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  43:     0x74e3220019d6 - rustc_interface[a50dc9db8085a4ed]::passes::create_and_enter_global_ctxt::<core[e7b6e93a788dc92f]::option::Option<rustc_interface[a50dc9db8085a4ed]::queries::Linker>, rustc_driver_impl[66c5506b25ac6c22]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  44:     0x74e321ff30ef - rustc_interface[a50dc9db8085a4ed]::interface::run_compiler::<(), rustc_driver_impl[66c5506b25ac6c22]::run_compiler::{closure#0}>::{closure#1}
  45:     0x74e321fb5078 - std[3b75cbde80eecb9]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[a50dc9db8085a4ed]::util::run_in_thread_with_globals<rustc_interface[a50dc9db8085a4ed]::util::run_in_thread_pool_with_globals<rustc_interface[a50dc9db8085a4ed]::interface::run_compiler<(), rustc_driver_impl[66c5506b25ac6c22]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  46:     0x74e321fb4d56 - <<std[3b75cbde80eecb9]::thread::Builder>::spawn_unchecked_<rustc_interface[a50dc9db8085a4ed]::util::run_in_thread_with_globals<rustc_interface[a50dc9db8085a4ed]::util::run_in_thread_pool_with_globals<rustc_interface[a50dc9db8085a4ed]::interface::run_compiler<(), rustc_driver_impl[66c5506b25ac6c22]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[e7b6e93a788dc92f]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  47:     0x74e321fb337d - std::sys::pal::unix::thread::Thread::new::thread_start::h10570da7ea11b19c
  48:     0x74e31ba5f7eb - <unknown>
  49:     0x74e31bae318c - <unknown>
  50:                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.90.0-nightly (5e749eb66 2025-06-29) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [type_of] computing type of `Bug::a`
#1 [inferred_outlives_crate] computing the inferred outlives-predicates for items in this crate
#2 [inferred_outlives_of] computing inferred outlives-predicates of `Bug`
#3 [predicates_of] computing predicates of `Bug`
#4 [check_well_formed] checking that `Bug` is well-formed
#5 [check_type_wf] checking that types are well-formed
#6 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 1 previous error; 1 warning emitted

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

@rustbot label +F-generic_const_exprs

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 by compiling the provided a.rs reproducer with the nightly rustc version shown, then inspect compiler/rustc_type_ir/src/binder.rs:629 and the query stack for type_of Bug::a. Trace the generic-argument instantiation path and add a regression test for this case; done means rustc reports a diagnostic or completes without an internal compiler error.

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
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.