Skip to content

ICE:normalizing free const aliases in the type system is unsupported #140729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sososopy opened this issue May 7, 2025 · 1 comment
Open

ICE:normalizing free const aliases in the type system is unsupported #140729

sososopy opened this issue May 7, 2025 · 1 comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@sososopy
Copy link

sososopy commented May 7, 2025

Code

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

const C: [[usize; 512]; 512];
pub struct A<const M: [[usize; 512]; 512]> {
}
impl A<C> {
    fn fun1() -> &'static str {}
}
impl A{
    fn fun1() -> &'static str {}
}

Meta

rustc --version --verbose:

rustc 1.88.0-nightly (27d6200a7 2025-05-06)
binary: rustc
commit-hash: 27d6200a70601f6fcf419bf2f9e37989f3624ca4
commit-date: 2025-05-06
host: x86_64-pc-windows-msvc
release: 1.88.0-nightly
LLVM version: 20.1.4

Error output

error: free constant item without body
    |
294 | const C: [[usize; 512]; 512];
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |                             |
    |                             help: provide a definition for the constant: `= <expr>;`
error[E0601]: `main` function not found in crate `test`
    |
302 | }
    |  ^ consider adding a `main` function`

error[E0107]: missing generics for struct `A`
    |
300 | impl A{
    |      ^ expected 1 generic argument
    |
note: struct defined here, with 1 generic parameter: `M`
    |
295 | pub struct A<const M: [[usize; 512]; 512]> {
    |            ^ ----------------------------
help: add missing generic argument
    |
300 | impl A<M>{
Backtrace

thread 'rustc' panicked at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4\compiler\rustc_next_trait_solver\src\solve\normalizes_to\free_alias.rs:37:13:
normalizing free const aliases in the type system is unsupported
stack backtrace:
   0:     0x7ffd6f8fb8f2 - std::backtrace_rs::backtrace::win64::trace
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\std\src\..\..\backtrace\src\backtrace\win64.rs:85
   1:     0x7ffd6f8fb8f2 - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ffd6f8fb8f2 - std::sys::backtrace::_print_fmt
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\std\src\sys\backtrace.rs:66
   3:     0x7ffd6f8fb8f2 - std::sys::backtrace::impl$0::print::impl$0::fmt
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\std\src\sys\backtrace.rs:39
   4:     0x7ffd6f92e0bb - core::fmt::rt::Argument::fmt
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\core\src\fmt\rt.rs:181
   5:     0x7ffd6f92e0bb - core::fmt::write
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\core\src\fmt\mod.rs:1446
   6:     0x7ffd6f8f18c7 - std::io::default_write_fmt
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\std\src\io\mod.rs:639
   7:     0x7ffd6f8f18c7 - std::io::Write::write_fmt<std::sys::stdio::windows::Stderr>
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\std\src\io\mod.rs:1914
   8:     0x7ffd6f8fb735 - std::sys::backtrace::BacktraceLock::print
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\std\src\sys\backtrace.rs:42
   9:     0x7ffd6f90138a - std::panicking::default_hook::closure$0
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\std\src\panicking.rs:300
  10:     0x7ffd6f901120 - std::panicking::default_hook
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\std\src\panicking.rs:327
  11:     0x7ffd71010639 - core[f3ba7138fd57ba46]::slice::sort::unstable::heapsort::heapsort::<((rustc_lint_defs[c47315345f7933c0]::Level, &str), usize), <((rustc_lint_defs[c47315345f7933c0]::Level, &str), usize) as core[f3ba7138fd57ba46]::cmp::PartialOrd>::lt>
  12:     0x7ffd6f90201e - std::panicking::rust_panic_with_hook
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\std\src\panicking.rs:841
  13:     0x7ffd6f901d42 - std::panicking::begin_panic_handler::closure$0
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\std\src\panicking.rs:699
  14:     0x7ffd6f8fc6af - std::sys::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\std\src\sys\backtrace.rs:168
  15:     0x7ffd6f90197e - std::panicking::begin_panic_handler
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\std\src\panicking.rs:697
  16:     0x7ffd72a78e01 - core::panicking::panic_fmt
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\core\src\panicking.rs:75
  17:     0x7ffd6f53e7a0 - rustc_codegen_ssa[b8af61421ef834af]::debuginfo::type_names::compute_debuginfo_vtable_name
  18:     0x7ffd6f52034b - rustc_codegen_ssa[b8af61421ef834af]::debuginfo::type_names::compute_debuginfo_vtable_name
  19:     0x7ffd6f545af6 - <alloc[ea825cf2ae0fac8d]::raw_vec::RawVec<rustc_trait_selection[d61a5f081a35f129]::solve::inspect::analyse::InspectCandidate>>::grow_one
  20:     0x7ffd6f548669 - <alloc[ea825cf2ae0fac8d]::raw_vec::RawVec<rustc_trait_selection[d61a5f081a35f129]::solve::inspect::analyse::InspectCandidate>>::grow_one
  21:     0x7ffd6f539df8 - rustc_codegen_ssa[b8af61421ef834af]::debuginfo::type_names::compute_debuginfo_vtable_name
  22:     0x7ffd6f52034b - rustc_codegen_ssa[b8af61421ef834af]::debuginfo::type_names::compute_debuginfo_vtable_name
  23:     0x7ffd6f545af6 - <alloc[ea825cf2ae0fac8d]::raw_vec::RawVec<rustc_trait_selection[d61a5f081a35f129]::solve::inspect::analyse::InspectCandidate>>::grow_one
  24:     0x7ffd6f58b5dd - rustc_trait_selection[d61a5f081a35f129]::traits::coherence::overlapping_impls
  25:     0x7ffd6f58a4a1 - rustc_trait_selection[d61a5f081a35f129]::traits::coherence::overlapping_impls
  26:     0x7ffd6f1378cc - rustc_hir_analysis[8932559348a889e3]::check::check_function_signature
  27:     0x7ffd6fc4b9ed - <rustc_hir_analysis[8932559348a889e3]::autoderef::Autoderef>::into_obligations
  28:     0x7ffd6f47c88b - <alloc[ea825cf2ae0fac8d]::sync::Arc<rustc_session[af420db3a1ddf9d5]::cstore::CrateSource>>::drop_slow
  29:     0x7ffd6f389bfa - RINvNtNtCs74TgHxZLeff_18rustc_query_system5query8plumbing17try_execute_queryINtCs4ZGfxhMUaYB_16rustc_query_impl13DynamicConfigINtNtB4_6caches11SingleCacheINtNtNtCsd1QdgvaAdwy_12rustc_middle5query5erase6ErasedAhj1_EEKb0_KB3s_KB3s_ENtNtB1f_8plumbing9QueryCtx
  30:     0x7ffd6f48f183 - rustc_query_impl[3a2da1cfd4e380b7]::query_system
  31:     0x7ffd6fc8be75 - rustc_hir_analysis[8932559348a889e3]::check_crate
  32:     0x7ffd6f9656f3 - <rustc_interface[de93994d21f55fb9]::passes::LintStoreExpandImpl as rustc_expand[c0fe915ae76c77fa]::base::LintStoreExpand>::pre_expansion_lint
  33:     0x7ffd6c26d6a7 - rustc_interface[de93994d21f55fb9]::passes::analysis
  34:     0x7ffd6f47cc1a - <alloc[ea825cf2ae0fac8d]::sync::Arc<rustc_session[af420db3a1ddf9d5]::cstore::CrateSource>>::drop_slow
  35:     0x7ffd6f3857fa - RINvNtNtCs74TgHxZLeff_18rustc_query_system5query8plumbing17try_execute_queryINtCs4ZGfxhMUaYB_16rustc_query_impl13DynamicConfigINtNtB4_6caches11SingleCacheINtNtNtCsd1QdgvaAdwy_12rustc_middle5query5erase6ErasedAhj0_EEKb0_KB3s_KB3s_ENtNtB1f_8plumbing9QueryCtx
  36:     0x7ffd6f483243 - rustc_query_impl[3a2da1cfd4e380b7]::query_system
  37:     0x7ffd6c22ecb5 - std[b9536bce84c2e315]::sys::backtrace::__rust_begin_short_backtrace::<<std[b9536bce84c2e315]::thread::Builder>::spawn_unchecked_<ctrlc[b16cc6ccfb573262]::set_handler_inner<rustc_driver_impl[35a33f1ecc58a238]::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>
  38:     0x7ffd6c228f13 - std[b9536bce84c2e315]::sys::backtrace::__rust_begin_short_backtrace::<<std[b9536bce84c2e315]::thread::Builder>::spawn_unchecked_<ctrlc[b16cc6ccfb573262]::set_handler_inner<rustc_driver_impl[35a33f1ecc58a238]::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>
  39:     0x7ffd6c22479f - RINvNtNtCsfUu5ctRylQ7_3std3sys9backtrace28___rust_begin_short_backtraceNCNCINvNtCsj6LJ5K1g9kH_15rustc_interface4util26run_in_thread_with_globalsNCINvB1e_31run_in_thread_pool_with_globalsNCINvNtB1g_9interface12run_compileruNCNvCs4BvKB23zGPs_17rustc_driver_i
  40:     0x7ffd6c233010 - std[b9536bce84c2e315]::sys::backtrace::__rust_begin_short_backtrace::<<std[b9536bce84c2e315]::thread::Builder>::spawn_unchecked_<ctrlc[b16cc6ccfb573262]::set_handler_inner<rustc_driver_impl[35a33f1ecc58a238]::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>
  41:     0x7ffd6f90638d - alloc::boxed::impl$28::call_once
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\alloc\src\boxed.rs:1966
  42:     0x7ffd6f90638d - alloc::boxed::impl$28::call_once
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\alloc\src\boxed.rs:1966
  43:     0x7ffd6f90638d - std::sys::pal::windows::thread::impl$0::new::thread_start
                               at /rustc/27d6200a70601f6fcf419bf2f9e37989f3624ca4/library\std\src\sys\pal\windows\thread.rs:56
  44:     0x7ffe4b087374 - BaseThreadInitThunk
  45:     0x7ffe4d09cc91 - RtlUserThreadStart

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

query stack during panic:
#0 [crate_inherent_impls_overlap_check] check for overlap between inherent impls defined in this crate
#1 [analysis] running analysis passes on this crate
end of query stack

@sososopy sososopy added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels May 7, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 7, 2025
@cyrgani
Copy link
Contributor

cyrgani commented May 7, 2025

#![feature(min_generic_const_args)]

const C: usize = 0;
pub struct A<const M: usize> {}
impl A<C> {
    fn fun1() {}
}
impl A {
    fn fun1() {}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants