Skip to content

[ICE]: ty::ConstKind::Error constructed but no error reported #151625

@reddevilmidzy

Description

@reddevilmidzy

Code

#![feature(min_generic_const_args, adt_const_params, unsized_const_params)]

fn foo<const X: (bool, i32)>() {
}

fn main() {
    foo::<{(1, 2)}>();
}

Meta

rustc --version --verbose:

rustc 1.95.0-nightly (d222ddc4d 2026-01-23)
binary: rustc
commit-hash: d222ddc4d90743dfc1e53b610be8fc9d95893d2c
commit-date: 2026-01-23
host: x86_64-pc-windows-msvc
release: 1.95.0-nightly
LLVM version: 21.1.8

Error output

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

warning: the feature `unsized_const_params` is incomplete and may not be safe to use and/or cause compiler crashes
 --> .\src\main.rs:1:54
  |
1 | #![feature(min_generic_const_args, adt_const_params, unsized_const_params)]
  |                                                      ^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information

warning: 2 warnings emitted

note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors

Backtrace

error: internal compiler error: ty::ConstKind::Error constructed but no error reported
  |
  = note: delayed at /rustc-dev/d222ddc4d90743dfc1e53b610be8fc9d95893d2c/compiler\rustc_mir_build\src\thir\constant.rs:90:21
             0: std::backtrace_rs::backtrace::win64::trace
                       at /rustc/d222ddc4d90743dfc1e53b610be8fc9d95893d2c/library\std\src\..\..\backtrace\src\backtrace\win64.rs:85
             1: std::backtrace_rs::backtrace::trace_unsynchronized
                       at /rustc/d222ddc4d90743dfc1e53b610be8fc9d95893d2c/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
             2: std::backtrace::Backtrace::create
                       at /rustc/d222ddc4d90743dfc1e53b610be8fc9d95893d2c/library\std\src\backtrace.rs:331
             3: std::backtrace::Backtrace::capture
                       at /rustc/d222ddc4d90743dfc1e53b610be8fc9d95893d2c/library\std\src\backtrace.rs:296
             4: <rustc_errors::DiagCtxtHandle>::has_errors_excluding_lint_errors
             5: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
             6: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
             7: <rustc_serialize::opaque::mem_encoder::MemEncoder>::panic_invalid_write::<5>
             8: <rustc_middle::ty::consts::Const>::new_misc_error
             9: <rustc_lint::builtin::SpecialModuleName as rustc_lint::passes::EarlyLintPass>::check_crate
            10: rustc_query_impl::profiling_support::alloc_self_profile_query_strings
            11: RINvNtNtCs34QVAf2vBYO_18rustc_query_system5query8plumbing17try_execute_queryINtCsbiVmqBw8rRZ_16rustc_query_impl13DynamicConfigINtNtB4_6caches12DefaultCacheNtNtNtCshTwDMUac5Aa_12rustc_middle3mir9interpret15LitToConstInputINtNtNtB2z_5query5erase6ErasedAhj8_E
            12: rustc_query_impl::profiling_support::alloc_self_profile_query_strings
            13: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_const_arg
            14: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_const_arg
            15: <<rustc_hir_typeck::fn_ctxt::FnCtxt>::instantiate_value_path::CtorGenericArgsCtxt as rustc_hir_analysis::hir_ty_lowering::GenericArgsLowerer>::provided_kind
            16: rustc_hir_typeck::typeck
            17: rustc_hir_typeck::typeck
            18: rustc_hir_typeck::typeck
            19: rustc_hir_typeck::typeck
            20: rustc_hir_typeck::typeck
            21: rustc_hir_typeck::typeck
            22: rustc_hir_typeck::typeck
            23: rustc_hir_typeck::intrinsicck::check_transmutes
            24: <hashbrown::raw::RawTable<usize>>::reserve_rehash::<indexmap::inner::get_hash<(rustc_middle::ty::predicate::Predicate, rustc_middle::traits::ObligationCause), ()>::{closure#0}>
            25: rustc_hir_typeck::typeck
            26: RINvMs6_NtCsbbqP6BDAd6w_9hashbrown3rawINtB6_8RawTableTTNtNtNtCshTwDMUac5Aa_12rustc_middle2ty8instance8InstanceNtNtNtBX_3mir4mono14CollectionModeETINtNtNtBX_5query5erase6ErasedAhj20_ENtNtNtCs34QVAf2vBYO_18rustc_query_system9dep_graph5graph12DepNodeIndexEEE1
            27: RINvNtNtCs34QVAf2vBYO_18rustc_query_system5query8plumbing17try_execute_queryINtCsbiVmqBw8rRZ_16rustc_query_impl13DynamicConfigINtNtCsiQLuZhbz1Vm_21rustc_data_structures9vec_cache8VecCacheNtNtCseevRozILHse_10rustc_span6def_id10LocalDefIdINtNtNtCshTwDMUac5Aa
            28: rustc_query_impl::plumbing::query_key_hash_verify_all
            29: rustc_hir_analysis::check_crate
            30: rustc_interface::passes::analysis
            31: <rustc_lint::builtin::SpecialModuleName as rustc_lint::passes::EarlyLintPass>::check_crate
            32: RINvNtNtCs34QVAf2vBYO_18rustc_query_system5query8plumbing17try_execute_queryINtCsbiVmqBw8rRZ_16rustc_query_impl13DynamicConfigINtNtB4_6caches11SingleCacheINtNtNtCshTwDMUac5Aa_12rustc_middle5query5erase6ErasedAhj0_EEKb0_KB3s_KB3s_ENtNtB1f_8plumbing9QueryCtx
            33: rustc_query_impl::profiling_support::alloc_self_profile_query_strings
            34: std::sys::backtrace::__rust_begin_short_backtrace::<std::thread::lifecycle::spawn_unchecked<ctrlc::set_handler_inner<rustc_driver_impl::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>
            35: RINvNtNtCseh1I7LLxQdL_3std3sys9backtrace28___rust_begin_short_backtraceNCNCINvNtCsjlLTVv95Pas_15rustc_interface4util26run_in_thread_with_globalsNCINvB1e_31run_in_thread_pool_with_globalsNCINvNtB1g_9interface12run_compileruNCNvCs8VUKmtCNrP1_17rustc_driver_i
            36: std::sys::backtrace::__rust_begin_short_backtrace::<std::thread::lifecycle::spawn_unchecked<ctrlc::set_handler_inner<rustc_driver_impl::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>
            37: std::sys::thread::windows::impl$0::new::thread_start
                       at /rustc/d222ddc4d90743dfc1e53b610be8fc9d95893d2c/library\std\src\sys\thread\windows.rs:58
            38: BaseThreadInitThunk
            39: RtlUserThreadStart


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 `~\zed\ps\rustc-ice-2026-01-25T01_49_27-14540.txt` to your bug report

note: rustc 1.95.0-nightly (d222ddc4d 2026-01-23) running on x86_64-pc-windows-msvc

query stack during panic:
end of query stack

Metadata

Metadata

Assignees

No one assigned

    Labels

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