-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-adt_const_params`#![feature(adt_const_params)]``#![feature(adt_const_params)]`F-min_generic_const_args`#![feature(min_generic_const_args)]``#![feature(min_generic_const_args)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Code
this compiles normally but ICEs with --emit=mir 🤔
//@ run-pass
#![expect(incomplete_features)]
#![feature(min_generic_const_args, adt_const_params)]
#![allow(dead_code)]
pub fn takes_array_u32<const A: [u8; 3]>() {}
pub fn generic_caller<const X: u32, const Y: u32>() {
takes_array_u32::<{ [X, Y, X] }>();
}
fn main() {}Meta
rustc --version --verbose:
rustc 1.94.0-nightly (2fd6efc32 2026-01-14)
binary: rustc
commit-hash: 2fd6efc32704647e64d3d646d21c4c68eae100e4
commit-date: 2026-01-14
host: x86_64-unknown-linux-gnu
release: 1.94.0-nightly
LLVM version: 21.1.8
Error output
rustc crash.rs --emit=mir
<output>
Backtrace
error: internal compiler error: /rustc-dev/2fd6efc32704647e64d3d646d21c4c68eae100e4/compiler/rustc_middle/src/ty/consts.rs:258:18: expected ConstKind::Value, got X/#0
thread 'rustc' (2437421) panicked at /rustc-dev/2fd6efc32704647e64d3d646d21c4c68eae100e4/compiler/rustc_middle/src/ty/consts.rs:258:18:
Box<dyn Any>
stack backtrace:
0: 0x7f74ba438483 - <<std[716c9a7a72e5c14e]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[c5ed12ab89cc536a]::fmt::Display>::fmt
1: 0x7f74baa0fac8 - core[c5ed12ab89cc536a]::fmt::write
2: 0x7f74ba44ee76 - <std[716c9a7a72e5c14e]::sys::stdio::unix::Stderr as std[716c9a7a72e5c14e]::io::Write>::write_fmt
3: 0x7f74ba40e4f8 - std[716c9a7a72e5c14e]::panicking::default_hook::{closure#0}
4: 0x7f74ba42bbb3 - std[716c9a7a72e5c14e]::panicking::default_hook
5: 0x7f74b941233a - std[716c9a7a72e5c14e]::panicking::update_hook::<alloc[9c68fdf4f4f29218]::boxed::Box<rustc_driver_impl[9e0e0d73617a7774]::install_ice_hook::{closure#1}>>::{closure#0}
6: 0x7f74ba42be92 - std[716c9a7a72e5c14e]::panicking::panic_with_hook
7: 0x7f74b944f031 - std[716c9a7a72e5c14e]::panicking::begin_panic::<rustc_errors[c8e975ba56da8595]::ExplicitBug>::{closure#0}
8: 0x7f74b943f416 - std[716c9a7a72e5c14e]::sys::backtrace::__rust_end_short_backtrace::<std[716c9a7a72e5c14e]::panicking::begin_panic<rustc_errors[c8e975ba56da8595]::ExplicitBug>::{closure#0}, !>
9: 0x7f74b943c929 - std[716c9a7a72e5c14e]::panicking::begin_panic::<rustc_errors[c8e975ba56da8595]::ExplicitBug>
10: 0x7f74b946cd71 - <rustc_errors[c8e975ba56da8595]::diagnostic::BugAbort as rustc_errors[c8e975ba56da8595]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
11: 0x7f74b9a1af69 - rustc_middle[768a97a14c80b733]::util::bug::opt_span_bug_fmt::<rustc_span[b4e9eefdbf3f5b0a]::span_encoding::Span>::{closure#0}
12: 0x7f74b9a1b0f2 - rustc_middle[768a97a14c80b733]::ty::context::tls::with_opt::<rustc_middle[768a97a14c80b733]::util::bug::opt_span_bug_fmt<rustc_span[b4e9eefdbf3f5b0a]::span_encoding::Span>::{closure#0}, !>::{closure#0}
13: 0x7f74b9a0c20b - rustc_middle[768a97a14c80b733]::ty::context::tls::with_context_opt::<rustc_middle[768a97a14c80b733]::ty::context::tls::with_opt<rustc_middle[768a97a14c80b733]::util::bug::opt_span_bug_fmt<rustc_span[b4e9eefdbf3f5b0a]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
14: 0x7f74b6ecf0b4 - rustc_middle[768a97a14c80b733]::util::bug::bug_fmt
15: 0x7f74b9a2a7dd - <rustc_middle[768a97a14c80b733]::ty::consts::Const>::to_value
16: 0x7f74b9a2add9 - <rustc_middle[768a97a14c80b733]::ty::consts::valtree::Value>::try_to_raw_bytes
17: 0x7f74b9ab3fea - <rustc_middle[768a97a14c80b733]::ty::print::pretty::FmtPrinter as rustc_middle[768a97a14c80b733]::ty::print::pretty::PrettyPrinter>::pretty_print_const_valtree
18: 0x7f74b9a6bc05 - <rustc_middle[768a97a14c80b733]::ty::generic_args::GenericArg as rustc_middle[768a97a14c80b733]::ty::print::Print<rustc_middle[768a97a14c80b733]::ty::print::pretty::FmtPrinter>>::print
19: 0x7f74b9a19da6 - <rustc_middle[768a97a14c80b733]::ty::print::pretty::FmtPrinter as rustc_middle[768a97a14c80b733]::ty::print::pretty::PrettyPrinter>::comma_sep::<rustc_middle[768a97a14c80b733]::ty::generic_args::GenericArg, core[c5ed12ab89cc536a]::iter::adapters::copied::Copied<core[c5ed12ab89cc536a]::slice::iter::Iter<rustc_middle[768a97a14c80b733]::ty::generic_args::GenericArg>>>
20: 0x7f74b9a12ae5 - <rustc_middle[768a97a14c80b733]::ty::print::pretty::FmtPrinter as rustc_middle[768a97a14c80b733]::ty::print::Printer>::print_path_with_generic_args::<<rustc_middle[768a97a14c80b733]::ty::print::pretty::FmtPrinter as rustc_middle[768a97a14c80b733]::ty::print::Printer>::default_print_def_path::{closure#0}>
21: 0x7f74bbec1cc7 - <rustc_middle[768a97a14c80b733]::ty::print::pretty::FmtPrinter as rustc_middle[768a97a14c80b733]::ty::print::Printer>::print_def_path
22: 0x7f74bbc49a4b - rustc_middle[768a97a14c80b733]::mir::pretty::pretty_print_const_value_tcx
23: 0x7f74bbc496d4 - <rustc_middle[768a97a14c80b733]::mir::consts::Const as core[c5ed12ab89cc536a]::fmt::Display>::fmt
24: 0x7f74baa0fac8 - core[c5ed12ab89cc536a]::fmt::write
25: 0x7f74b9a73167 - <&alloc[9c68fdf4f4f29218]::boxed::Box<rustc_middle[768a97a14c80b733]::mir::syntax::ConstOperand> as core[c5ed12ab89cc536a]::fmt::Debug>::fmt
26: 0x7f74baa0fac8 - core[c5ed12ab89cc536a]::fmt::write
27: 0x7f74b9a9a36e - <rustc_middle[768a97a14c80b733]::mir::syntax::Operand as core[c5ed12ab89cc536a]::fmt::Debug>::fmt
28: 0x7f74baa0fac8 - core[c5ed12ab89cc536a]::fmt::write
29: 0x7f74b9a938a4 - <rustc_middle[768a97a14c80b733]::mir::syntax::TerminatorKind as core[c5ed12ab89cc536a]::fmt::Debug>::fmt
30: 0x7f74baa0fac8 - core[c5ed12ab89cc536a]::fmt::write
31: 0x7f74baa0f92b - alloc[9c68fdf4f4f29218]::fmt::format::format_inner
32: 0x7f74b9a255e8 - <rustc_middle[768a97a14c80b733]::mir::pretty::MirWriter>::write_mir_fn
33: 0x7f74b9a1be7b - rustc_middle[768a97a14c80b733]::mir::pretty::write_mir_pretty::{closure#0}
34: 0x7f74b9a46aec - rustc_middle[768a97a14c80b733]::mir::pretty::write_mir_pretty
35: 0x7f74b89a9b46 - rustc_mir_transform[79e0ef8e1e5cd641]::dump_mir::emit_mir
36: 0x7f74bbd9a9f4 - <rustc_interface[65e39d58a07ddaab]::passes::create_and_enter_global_ctxt<core[c5ed12ab89cc536a]::option::Option<rustc_interface[65e39d58a07ddaab]::queries::Linker>, rustc_driver_impl[9e0e0d73617a7774]::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core[c5ed12ab89cc536a]::ops::function::FnOnce<(&rustc_session[6961dae008f24ff4]::session::Session, rustc_middle[768a97a14c80b733]::ty::context::CurrentGcx, alloc[9c68fdf4f4f29218]::sync::Arc<rustc_data_structures[63c25ecf69161d59]::jobserver::Proxy>, &std[716c9a7a72e5c14e]::sync::once_lock::OnceLock<rustc_middle[768a97a14c80b733]::ty::context::GlobalCtxt>, &rustc_data_structures[63c25ecf69161d59]::sync::worker_local::WorkerLocal<rustc_middle[768a97a14c80b733]::arena::Arena>, &rustc_data_structures[63c25ecf69161d59]::sync::worker_local::WorkerLocal<rustc_hir[dd7ccd0b62a5cbbd]::Arena>, rustc_driver_impl[9e0e0d73617a7774]::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
37: 0x7f74bbc84cd8 - rustc_interface[65e39d58a07ddaab]::interface::run_compiler::<(), rustc_driver_impl[9e0e0d73617a7774]::run_compiler::{closure#0}>::{closure#1}
38: 0x7f74bbbf33ce - std[716c9a7a72e5c14e]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[65e39d58a07ddaab]::util::run_in_thread_with_globals<rustc_interface[65e39d58a07ddaab]::util::run_in_thread_pool_with_globals<rustc_interface[65e39d58a07ddaab]::interface::run_compiler<(), rustc_driver_impl[9e0e0d73617a7774]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
39: 0x7f74bbbf31a0 - <std[716c9a7a72e5c14e]::thread::lifecycle::spawn_unchecked<rustc_interface[65e39d58a07ddaab]::util::run_in_thread_with_globals<rustc_interface[65e39d58a07ddaab]::util::run_in_thread_pool_with_globals<rustc_interface[65e39d58a07ddaab]::interface::run_compiler<(), rustc_driver_impl[9e0e0d73617a7774]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[c5ed12ab89cc536a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
40: 0x7f74bbbf4f44 - <std[716c9a7a72e5c14e]::sys::thread::unix::Thread>::new::thread_start
41: 0x7f74b549698b - <unknown>
42: 0x7f74b551a9cc - <unknown>
43: 0x0 - <unknown>
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 `/tmp/im/rustc-ice-2026-01-14T16_49_26-2437419.txt` to your bug report
note: rustc 1.94.0-nightly (2fd6efc32 2026-01-14) running on x86_64-unknown-linux-gnu
query stack during panic:
end of query stack
error: aborting due to 1 previous error
reddevilmidzy
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-adt_const_params`#![feature(adt_const_params)]``#![feature(adt_const_params)]`F-min_generic_const_args`#![feature(min_generic_const_args)]``#![feature(min_generic_const_args)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.