Skip to content

ICE: mgca: Val(ZeroSized ..) has parameters, but no args were provided in instantiate #147415

@matthiaskrgr

Description

@matthiaskrgr

seems to bisect to #140553

snippet:

#![feature(min_generic_const_args)]

fn foo<T>() {
    [0; size_of::<*mut T>()]
}

Version information

rustc 1.92.0-nightly (8111a2d6d 2025-10-06)
binary: rustc
commit-hash: 8111a2d6da405e9684a8a83c2c9d69036bf23f12
commit-date: 2025-10-06
host: x86_64-unknown-linux-gnu
release: 1.92.0-nightly
LLVM version: 21.1.2

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

Program output

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

error[E0601]: `main` function not found in crate `mvce`
 --> /tmp/icemaker_global_tempdir.m19l8SA8m9s8/rustc_testrunner_tmpdir_reporting.WMiy594FXSbC/mvce.rs:5:2
  |
5 | }
  |  ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.m19l8SA8m9s8/rustc_testrunner_tmpdir_reporting.WMiy594FXSbC/mvce.rs`


thread 'rustc' (2576543) panicked at /rustc-dev/8111a2d6da405e9684a8a83c2c9d69036bf23f12/compiler/rustc_type_ir/src/binder.rs:646:13:
Val(ZeroSized, FnDef(DefId(2:2304 ~ core[016b]::mem::size_of), [*mut T/#0])) has parameters, but no args were provided in instantiate
stack backtrace:
   0:     0x7f48bf3c5933 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h9d493bf7fa709445
   1:     0x7f48bfa01fbc - core::fmt::write::hc6c08c30b818d85a
   2:     0x7f48bf37a333 - std::io::Write::write_fmt::h1a8070f00bb47620
   3:     0x7f48bf38b8f2 - std::sys::backtrace::BacktraceLock::print::he5d95542d2b86573
   4:     0x7f48bf391969 - std::panicking::default_hook::{{closure}}::hf509239352864b0b
   5:     0x7f48bf391493 - std::panicking::default_hook::h41a205ba0e6bad2c
   6:     0x7f48be3a6af7 - std[5bd9112d56c9e542]::panicking::update_hook::<alloc[8dd70e2de2dd10a]::boxed::Box<rustc_driver_impl[799d235ef8173497]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x7f48bf391d8f - std::panicking::panic_with_hook::h423ed9a60c1bb0bf
   8:     0x7f48bf391b4a - std::panicking::panic_handler::{{closure}}::h380789c533e4be75
   9:     0x7f48bf38ba39 - std::sys::backtrace::__rust_end_short_backtrace::h6043c6eeb7d07ee0
  10:     0x7f48bf36c56d - __rustc[79156e1635b10208]::rust_begin_unwind
  11:     0x7f48bc3b7230 - core::panicking::panic_fmt::h566dcbe782a35b3a
  12:     0x7f48bfcab033 - <rustc_const_eval[47651ca69e396203]::interpret::eval_context::InterpCx<rustc_const_eval[47651ca69e396203]::const_eval::machine::CompileTimeMachine>>::eval_operand
  13:     0x7f48c06bce12 - <rustc_const_eval[47651ca69e396203]::interpret::eval_context::InterpCx<rustc_const_eval[47651ca69e396203]::const_eval::machine::CompileTimeMachine>>::eval_callee_and_args
  14:     0x7f48c06d8890 - rustc_const_eval[47651ca69e396203]::const_eval::eval_queries::eval_to_allocation_raw_provider
  15:     0x7f48c06d5a90 - rustc_query_impl[836c1e68a123fbf6]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[836c1e68a123fbf6]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[244f91c2aa28f1b4]::query::erase::Erased<[u8; 24usize]>>
  16:     0x7f48c06cb51b - rustc_query_system[686fc956cf50412b]::query::plumbing::try_execute_query::<rustc_query_impl[836c1e68a123fbf6]::DynamicConfig<rustc_query_system[686fc956cf50412b]::query::caches::DefaultCache<rustc_middle[244f91c2aa28f1b4]::ty::PseudoCanonicalInput<rustc_middle[244f91c2aa28f1b4]::mir::interpret::GlobalId>, rustc_middle[244f91c2aa28f1b4]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[836c1e68a123fbf6]::plumbing::QueryCtxt, false>
  17:     0x7f48c06cb0b9 - rustc_query_impl[836c1e68a123fbf6]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
  18:     0x7f48c06c9e84 - rustc_const_eval[47651ca69e396203]::const_eval::valtrees::eval_to_valtree
  19:     0x7f48c06c9c25 - rustc_query_impl[836c1e68a123fbf6]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[836c1e68a123fbf6]::query_impl::eval_to_valtree::dynamic_query::{closure#2}::{closure#0}, rustc_middle[244f91c2aa28f1b4]::query::erase::Erased<[u8; 16usize]>>
  20:     0x7f48bfc5edb8 - rustc_query_system[686fc956cf50412b]::query::plumbing::try_execute_query::<rustc_query_impl[836c1e68a123fbf6]::DynamicConfig<rustc_query_system[686fc956cf50412b]::query::caches::DefaultCache<rustc_middle[244f91c2aa28f1b4]::ty::PseudoCanonicalInput<rustc_middle[244f91c2aa28f1b4]::mir::interpret::GlobalId>, rustc_middle[244f91c2aa28f1b4]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[836c1e68a123fbf6]::plumbing::QueryCtxt, false>
  21:     0x7f48bfc5e970 - rustc_query_impl[836c1e68a123fbf6]::query_impl::eval_to_valtree::get_query_non_incr::__rust_end_short_backtrace
  22:     0x7f48bfc5da8f - <rustc_middle[244f91c2aa28f1b4]::ty::context::TyCtxt>::const_eval_resolve_for_typeck
  23:     0x7f48bfc5c734 - rustc_trait_selection[899f8063f9e18b59]::traits::try_evaluate_const
  24:     0x7f48bf1df185 - rustc_trait_selection[899f8063f9e18b59]::traits::evaluate_const
  25:     0x7f48c0e6698a - <rustc_trait_selection[899f8063f9e18b59]::traits::normalize::AssocTypeNormalizer>::normalize_free_alias::{closure#0}
  26:     0x7f48bfc38ebf - <rustc_trait_selection[899f8063f9e18b59]::traits::normalize::AssocTypeNormalizer as rustc_type_ir[e6111309e8ec97af]::fold::TypeFolder<rustc_middle[244f91c2aa28f1b4]::ty::context::TyCtxt>>::fold_const
  27:     0x7f48c0ab0433 - <rustc_hir_typeck[a357daf55cb619c8]::fn_ctxt::FnCtxt>::normalize::<rustc_middle[244f91c2aa28f1b4]::ty::consts::Const>
  28:     0x7f48c092657d - <rustc_hir_typeck[a357daf55cb619c8]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  29:     0x7f48c0914422 - <rustc_hir_typeck[a357daf55cb619c8]::fn_ctxt::FnCtxt>::check_expr_block
  30:     0x7f48c091c6ac - <rustc_hir_typeck[a357daf55cb619c8]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  31:     0x7f48bfc07b48 - rustc_hir_typeck[a357daf55cb619c8]::check::check_fn
  32:     0x7f48c0ba221b - rustc_hir_typeck[a357daf55cb619c8]::typeck_with_inspect::{closure#0}
  33:     0x7f48c0ba0bce - rustc_query_impl[836c1e68a123fbf6]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[836c1e68a123fbf6]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[244f91c2aa28f1b4]::query::erase::Erased<[u8; 8usize]>>
  34:     0x7f48bfd1ba04 - rustc_query_system[686fc956cf50412b]::query::plumbing::try_execute_query::<rustc_query_impl[836c1e68a123fbf6]::DynamicConfig<rustc_data_structures[70eb418aee26b76d]::vec_cache::VecCache<rustc_span[6b3d398326812288]::def_id::LocalDefId, rustc_middle[244f91c2aa28f1b4]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[686fc956cf50412b]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[836c1e68a123fbf6]::plumbing::QueryCtxt, false>
  35:     0x7f48bfd1b389 - rustc_query_impl[836c1e68a123fbf6]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
  36:     0x7f48c04f5b79 - <rustc_middle[244f91c2aa28f1b4]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_hir_analysis[6c2a83d55c380820]::check_crate::{closure#2}>::{closure#0}
  37:     0x7f48c04f4e18 - rustc_hir_analysis[6c2a83d55c380820]::check_crate
  38:     0x7f48bfd11430 - rustc_interface[8b029a4f81d57bf6]::passes::analysis
  39:     0x7f48bfd110f5 - rustc_query_impl[836c1e68a123fbf6]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[836c1e68a123fbf6]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[244f91c2aa28f1b4]::query::erase::Erased<[u8; 0usize]>>
  40:     0x7f48c0964520 - rustc_query_system[686fc956cf50412b]::query::plumbing::try_execute_query::<rustc_query_impl[836c1e68a123fbf6]::DynamicConfig<rustc_query_system[686fc956cf50412b]::query::caches::SingleCache<rustc_middle[244f91c2aa28f1b4]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[836c1e68a123fbf6]::plumbing::QueryCtxt, false>
  41:     0x7f48c0964308 - rustc_query_impl[836c1e68a123fbf6]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  42:     0x7f48c0c22000 - rustc_interface[8b029a4f81d57bf6]::passes::create_and_enter_global_ctxt::<core[16b3fef4fa94656]::option::Option<rustc_interface[8b029a4f81d57bf6]::queries::Linker>, rustc_driver_impl[799d235ef8173497]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  43:     0x7f48c0c29b03 - <rustc_interface[8b029a4f81d57bf6]::passes::create_and_enter_global_ctxt<core[16b3fef4fa94656]::option::Option<rustc_interface[8b029a4f81d57bf6]::queries::Linker>, rustc_driver_impl[799d235ef8173497]::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core[16b3fef4fa94656]::ops::function::FnOnce<(&rustc_session[62811e3f1498e52e]::session::Session, rustc_middle[244f91c2aa28f1b4]::ty::context::CurrentGcx, alloc[8dd70e2de2dd10a]::sync::Arc<rustc_data_structures[70eb418aee26b76d]::jobserver::Proxy>, &std[5bd9112d56c9e542]::sync::once_lock::OnceLock<rustc_middle[244f91c2aa28f1b4]::ty::context::GlobalCtxt>, &rustc_data_structures[70eb418aee26b76d]::sync::worker_local::WorkerLocal<rustc_middle[244f91c2aa28f1b4]::arena::Arena>, &rustc_data_structures[70eb418aee26b76d]::sync::worker_local::WorkerLocal<rustc_hir[b3b90dd82afea593]::Arena>, rustc_driver_impl[799d235ef8173497]::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  44:     0x7f48c0bf7d7e - rustc_interface[8b029a4f81d57bf6]::interface::run_compiler::<(), rustc_driver_impl[799d235ef8173497]::run_compiler::{closure#0}>::{closure#1}
  45:     0x7f48c0b096c7 - std[5bd9112d56c9e542]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[8b029a4f81d57bf6]::util::run_in_thread_with_globals<rustc_interface[8b029a4f81d57bf6]::util::run_in_thread_pool_with_globals<rustc_interface[8b029a4f81d57bf6]::interface::run_compiler<(), rustc_driver_impl[799d235ef8173497]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  46:     0x7f48c0b093a8 - <<std[5bd9112d56c9e542]::thread::Builder>::spawn_unchecked_<rustc_interface[8b029a4f81d57bf6]::util::run_in_thread_with_globals<rustc_interface[8b029a4f81d57bf6]::util::run_in_thread_pool_with_globals<rustc_interface[8b029a4f81d57bf6]::interface::run_compiler<(), rustc_driver_impl[799d235ef8173497]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[16b3fef4fa94656]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  47:     0x7f48c0b0facd - std::sys::thread::unix::Thread::new::thread_start::h41545b42ecfc43e3
  48:     0x7f48ba4969cb - <unknown>
  49:     0x7f48ba51aa0c - <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.92.0-nightly (8111a2d6d 2025-10-06) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `foo::{constant#0}`
#1 [eval_to_valtree] evaluating type-level constant
#2 [typeck] type-checking `foo`
#3 [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-min_generic_const_args

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-min_generic_const_args`#![feature(min_generic_const_args)]`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.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions