-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Closed as not planned
Labels
C-bugCategory: This is a bug.Category: This is a bug.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
enum Eek {
TheConst,
UnusedByTheConst(Eek),
}
const EEK_ZERO: &[Eek] = &[];
fn main() {}Meta
rustc --version --verbose:
binary: rustc
commit-hash: b91a3a05609a46f73d23e0995ae7ebb4a4f429a5
commit-date: 2024-11-07
host: x86_64-unknown-linux-gnu
release: 1.84.0-nightly
LLVM version: 19.1.3
Error output
error[E0072]: recursive type `Eek` has infinite size
--> mutant.rs:1:1
|
1 | enum Eek {
| ^^^^^^^^
2 | TheConst,
3 | UnusedByTheConst(Eek),
| --- recursive without indirection
|
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
3 | UnusedByTheConst(Box<Eek>),
| ++++ +
error[E0391]: cycle detected when computing layout of `Eek`
|
= note: ...which immediately requires computing layout of `Eek` again
= note: cycle used when computing layout of `[Eek; 0]`
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error[E0080]: evaluation of constant value failed
--> mutant.rs:5:27
|
5 | const EEK_ZERO: &[Eek] = &[];
| ^^ a cycle occurred during layout computation
error: internal compiler error: compiler/rustc_const_eval/src/interpret/eval_context.rs:601:33: interpret const eval failure of Unevaluated(UnevaluatedConst { def: DefId(0:9 ~ mutant[20f1]::EEK_ZERO), args: [], promoted: Some(promoted[0]) }, &'{erased} [Eek; 0_usize]) which is not in required_consts
--> mutant.rs:5:26
|
5 | const EEK_ZERO: &[Eek] = &[];
| ^^^
thread 'rustc' panicked at compiler/rustc_const_eval/src/interpret/eval_context.rs:601:33:
Box<dyn Any>
stack backtrace:
...
note: compiler flags: --crate-type staticlib -C link-dead-code -C debuginfo=2 -C opt-level=3 -Z mir-opt-level=3
query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `EEK_ZERO`
#1 [eval_to_const_value_raw] simplifying constant for the type system `EEK_ZERO`
end of query stack
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0072, E0080, E0391.
For more information about an error, try `rustc --explain E0072`
Backtrace
stack backtrace:
0: 0x7f539a65517a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hfadad24fb33e3d1a
1: 0x7f539ae040a6 - core::fmt::write::h42d25fbda60cd99f
2: 0x7f539c1c3351 - std::io::Write::write_fmt::hc2819193e80b365e
3: 0x7f539a654fd2 - std::sys::backtrace::BacktraceLock::print::h9450230402d77664
4: 0x7f539a6574d6 - std::panicking::default_hook::{{closure}}::h739047d4d787c596
5: 0x7f539a657320 - std::panicking::default_hook::h203d1229480f37a5
6: 0x7f53996d2269 - std[56fe22ad9ea837fd]::panicking::update_hook::<alloc[b5641001d343df5f]::boxed::Box<rustc_driver_impl[945e9afaf49c7d35]::install_ice_hook::{closure#0}>>::{closure#0}
7: 0x7f539a657be8 - std::panicking::rust_panic_with_hook::h657fdcc17f7e2546
8: 0x7f539970c191 - std[56fe22ad9ea837fd]::panicking::begin_panic::<rustc_errors[43c84716ac990581]::ExplicitBug>::{closure#0}
9: 0x7f53996ff166 - std[56fe22ad9ea837fd]::sys::backtrace::__rust_end_short_backtrace::<std[56fe22ad9ea837fd]::panicking::begin_panic<rustc_errors[43c84716ac990581]::ExplicitBug>::{closure#0}, !>
10: 0x7f53996feefe - std[56fe22ad9ea837fd]::panicking::begin_panic::<rustc_errors[43c84716ac990581]::ExplicitBug>
11: 0x7f5399715e71 - <rustc_errors[43c84716ac990581]::diagnostic::BugAbort as rustc_errors[43c84716ac990581]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
12: 0x7f539961c09c - <rustc_errors[43c84716ac990581]::DiagCtxtHandle>::span_bug::<rustc_span[db86d96c2ae2e3a4]::span_encoding::Span, alloc[b5641001d343df5f]::string::String>
13: 0x7f5399643757 - rustc_middle[f0eb6ba890d0a9bb]::util::bug::opt_span_bug_fmt::<rustc_span[db86d96c2ae2e3a4]::span_encoding::Span>::{closure#0}
14: 0x7f539964378a - rustc_middle[f0eb6ba890d0a9bb]::ty::context::tls::with_opt::<rustc_middle[f0eb6ba890d0a9bb]::util::bug::opt_span_bug_fmt<rustc_span[db86d96c2ae2e3a4]::span_encoding::Span>::{closure#0}, !>::{closure#0}
15: 0x7f539962eb2b - rustc_middle[f0eb6ba890d0a9bb]::ty::context::tls::with_context_opt::<rustc_middle[f0eb6ba890d0a9bb]::ty::context::tls::with_opt<rustc_middle[f0eb6ba890d0a9bb]::util::bug::opt_span_bug_fmt<rustc_span[db86d96c2ae2e3a4]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
16: 0x7f53988000e7 - rustc_middle[f0eb6ba890d0a9bb]::util::bug::span_bug_fmt::<rustc_span[db86d96c2ae2e3a4]::span_encoding::Span>
17: 0x7f539b782cdf - <rustc_const_eval[7b31d01bb6bba4c4]::interpret::eval_context::InterpCx<rustc_const_eval[7b31d01bb6bba4c4]::const_eval::machine::CompileTimeMachine>>::eval_rvalue_into_place
18: 0x7f539b74b22d - rustc_const_eval[7b31d01bb6bba4c4]::const_eval::eval_queries::eval_to_allocation_raw_provider
19: 0x7f539b74a436 - rustc_query_impl[1357963d8dd30e8b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1357963d8dd30e8b]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[f0eb6ba890d0a9bb]::query::erase::Erased<[u8; 24usize]>>
20: 0x7f539b74574b - rustc_query_system[887bb79932b1d8c1]::query::plumbing::try_execute_query::<rustc_query_impl[1357963d8dd30e8b]::DynamicConfig<rustc_query_system[887bb79932b1d8c1]::query::caches::DefaultCache<rustc_middle[f0eb6ba890d0a9bb]::ty::ParamEnvAnd<rustc_middle[f0eb6ba890d0a9bb]::mir::interpret::GlobalId>, rustc_middle[f0eb6ba890d0a9bb]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[1357963d8dd30e8b]::plumbing::QueryCtxt, false>
21: 0x7f539b745339 - rustc_query_impl[1357963d8dd30e8b]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
22: 0x7f539b746998 - rustc_const_eval[7b31d01bb6bba4c4]::const_eval::eval_queries::eval_to_const_value_raw_provider
23: 0x7f539b7467b6 - rustc_query_impl[1357963d8dd30e8b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1357963d8dd30e8b]::query_impl::eval_to_const_value_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[f0eb6ba890d0a9bb]::query::erase::Erased<[u8; 24usize]>>
24: 0x7f539b74570e - rustc_query_system[887bb79932b1d8c1]::query::plumbing::try_execute_query::<rustc_query_impl[1357963d8dd30e8b]::DynamicConfig<rustc_query_system[887bb79932b1d8c1]::query::caches::DefaultCache<rustc_middle[f0eb6ba890d0a9bb]::ty::ParamEnvAnd<rustc_middle[f0eb6ba890d0a9bb]::mir::interpret::GlobalId>, rustc_middle[f0eb6ba890d0a9bb]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[1357963d8dd30e8b]::plumbing::QueryCtxt, false>
25: 0x7f539b74524d - rustc_query_impl[1357963d8dd30e8b]::query_impl::eval_to_const_value_raw::get_query_non_incr::__rust_end_short_backtrace
26: 0x7f539b521df7 - <rustc_middle[f0eb6ba890d0a9bb]::hir::map::Map>::par_body_owners::<rustc_hir_analysis[af6e6fecb0b5810e]::check_crate::{closure#3}>::{closure#0}
27: 0x7f539b51f7b1 - rustc_hir_analysis[af6e6fecb0b5810e]::check_crate
28: 0x7f539b668aca - rustc_interface[5fea8bf9cd0b71b5]::passes::run_required_analyses
29: 0x7f539bc0861e - rustc_interface[5fea8bf9cd0b71b5]::passes::analysis
30: 0x7f539bc085ef - rustc_query_impl[1357963d8dd30e8b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1357963d8dd30e8b]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[f0eb6ba890d0a9bb]::query::erase::Erased<[u8; 1usize]>>
31: 0x7f539bd92cee - rustc_query_system[887bb79932b1d8c1]::query::plumbing::try_execute_query::<rustc_query_impl[1357963d8dd30e8b]::DynamicConfig<rustc_query_system[887bb79932b1d8c1]::query::caches::SingleCache<rustc_middle[f0eb6ba890d0a9bb]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[1357963d8dd30e8b]::plumbing::QueryCtxt, false>
32: 0x7f539bd929ce - rustc_query_impl[1357963d8dd30e8b]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
33: 0x7f539bc8707a - rustc_interface[5fea8bf9cd0b71b5]::interface::run_compiler::<core[5ba82ee3405aa490]::result::Result<(), rustc_span[db86d96c2ae2e3a4]::ErrorGuaranteed>, rustc_driver_impl[945e9afaf49c7d35]::run_compiler::{closure#0}>::{closure#1}
34: 0x7f539bccd5d0 - std[56fe22ad9ea837fd]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[5fea8bf9cd0b71b5]::util::run_in_thread_with_globals<rustc_interface[5fea8bf9cd0b71b5]::util::run_in_thread_pool_with_globals<rustc_interface[5fea8bf9cd0b71b5]::interface::run_compiler<core[5ba82ee3405aa490]::result::Result<(), rustc_span[db86d96c2ae2e3a4]::ErrorGuaranteed>, rustc_driver_impl[945e9afaf49c7d35]::run_compiler::{closure#0}>::{closure#1}, core[5ba82ee3405aa490]::result::Result<(), rustc_span[db86d96c2ae2e3a4]::ErrorGuaranteed>>::{closure#0}, core[5ba82ee3405aa490]::result::Result<(), rustc_span[db86d96c2ae2e3a4]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[5ba82ee3405aa490]::result::Result<(), rustc_span[db86d96c2ae2e3a4]::ErrorGuaranteed>>
35: 0x7f539bccd9eb - <<std[56fe22ad9ea837fd]::thread::Builder>::spawn_unchecked_<rustc_interface[5fea8bf9cd0b71b5]::util::run_in_thread_with_globals<rustc_interface[5fea8bf9cd0b71b5]::util::run_in_thread_pool_with_globals<rustc_interface[5fea8bf9cd0b71b5]::interface::run_compiler<core[5ba82ee3405aa490]::result::Result<(), rustc_span[db86d96c2ae2e3a4]::ErrorGuaranteed>, rustc_driver_impl[945e9afaf49c7d35]::run_compiler::{closure#0}>::{closure#1}, core[5ba82ee3405aa490]::result::Result<(), rustc_span[db86d96c2ae2e3a4]::ErrorGuaranteed>>::{closure#0}, core[5ba82ee3405aa490]::result::Result<(), rustc_span[db86d96c2ae2e3a4]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[5ba82ee3405aa490]::result::Result<(), rustc_span[db86d96c2ae2e3a4]::ErrorGuaranteed>>::{closure#1} as core[5ba82ee3405aa490]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
36: 0x7f539bcce4b9 - std::sys::pal::unix::thread::Thread::new::thread_start::hb3d6392adeea417c
37: 0x7f5395e6bac3 - start_thread
at ./nptl/pthread_create.c:442:8
38: 0x7f5395efd850 - __GI___clone3
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
39: 0x0 - <unknown>
Anything else?
This issue is similar to #124348; however, #124348 does not report an ICE on the current nightly version. The difference is the addition of a main function.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.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.