-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Open
Labels
C-bugCategory: This is a bug.Category: This is a bug.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.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.This issue may need triage. Remove it if it has been sufficiently triaged.
Description
auto-reduced (treereduce-rust):
#![feature(min_generic_const_args)]
fn func() -> [u8; { () }] {
loop {}
}
fn main() {}original:
// Regression test for #114918
//~^ ERROR mismatched types
// produces a type mismatch error instead of triggering a const eval cycle
#[allow(unused_braces)]
fn func() -> [u8; { () } ] { //~ ERROR mismatched types
loop {}
}
fn main() {}Version information
rustc 1.94.0-nightly (1b9ae9edd 2026-01-10)
binary: rustc
commit-hash: 1b9ae9eddcbd3b0105a0828e323c6db5f1e6ad0c
commit-date: 2026-01-10
host: x86_64-unknown-linux-gnu
release: 1.94.0-nightly
LLVM version: 21.1.8
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Zcrate-attr=feature(min_generic_const_args)
Program output
warning: the feature `min_generic_const_args` is incomplete and may not be safe to use and/or cause compiler crashes
--> <crate attribute>: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
warning: unnecessary braces around const expression
--> /tmp/icemaker_global_tempdir.IFSBFTilfzuQ/rustc_testrunner_tmpdir_reporting.Ca08HyrvfVme/mvce.rs:1:19
|
1 | fn func() -> [u8; { () }] {
| ^^ ^^
|
= note: `#[warn(unused_braces)]` (part of `#[warn(unused)]`) on by default
help: remove these braces
|
1 - fn func() -> [u8; { () }] {
1 + fn func() -> [u8; () ] {
|
warning: function `func` is never used
--> /tmp/icemaker_global_tempdir.IFSBFTilfzuQ/rustc_testrunner_tmpdir_reporting.Ca08HyrvfVme/mvce.rs:1:4
|
1 | fn func() -> [u8; { () }] {
| ^^^^
|
= note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default
warning: 3 warnings emitted
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: unsupported const tuple
--> /tmp/icemaker_global_tempdir.IFSBFTilfzuQ/rustc_testrunner_tmpdir_reporting.Ca08HyrvfVme/mvce.rs:1:21
|
1 | fn func() -> [u8; { () }] {
| ^^
|
note: delayed at /rustc-dev/1b9ae9eddcbd3b0105a0828e323c6db5f1e6ad0c/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs:2505:20
0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
3: <rustc_errors::DiagCtxtHandle>::span_delayed_bug::<rustc_span::span_encoding::Span, &str>
4: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_const_arg
5: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_ty
6: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_fn_ty
7: rustc_hir_analysis::collect::lower_fn_sig_recovering_infer_ret_ty
8: rustc_hir_analysis::collect::fn_sig
9: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::fn_sig::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 24]>>
10: <rustc_query_impl::query_impl::fn_sig::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId)>>::call_once
11: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 24]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
12: rustc_query_impl::query_impl::fn_sig::get_query_non_incr::__rust_end_short_backtrace
13: rustc_hir_analysis::check::check::check_item_type
14: rustc_hir_analysis::check::wfcheck::check_well_formed
15: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
16: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 1]>, rustc_query_system::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
17: rustc_query_impl::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
18: rustc_hir_analysis::check::wfcheck::check_type_wf
19: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
20: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
21: rustc_query_impl::query_impl::check_type_wf::get_query_non_incr::__rust_end_short_backtrace
22: rustc_hir_analysis::check_crate
23: rustc_interface::passes::analysis
24: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 0]>>
25: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
26: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
27: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
28: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
29: std::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
30: <std::thread::lifecycle::spawn_unchecked<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
31: <std::sys::thread::unix::Thread>::new::thread_start
32: <unknown>
33: <unknown>
--> /tmp/icemaker_global_tempdir.IFSBFTilfzuQ/rustc_testrunner_tmpdir_reporting.Ca08HyrvfVme/mvce.rs:1:21
|
1 | fn func() -> [u8; { () }] {
| ^^
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.94.0-nightly (1b9ae9edd 2026-01-10) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z crate-attr=feature(min_generic_const_args) -Z dump-mir-dir=dir
query stack during panic:
end of query stack
@rustbot label +F-min_generic_const_args
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.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.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.This issue may need triage. Remove it if it has been sufficiently triaged.