Skip to content
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

[ICE] Couldn't translate Aggregate { sized: true } as backend immediate #110032

Closed
spcan opened this issue Apr 7, 2023 · 4 comments · Fixed by #110021
Closed

[ICE] Couldn't translate Aggregate { sized: true } as backend immediate #110032

spcan opened this issue Apr 7, 2023 · 4 comments · Fixed by #110021
Labels
C-bug Category: This is a bug. 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.

Comments

@spcan
Copy link

spcan commented Apr 7, 2023

Code

Code is too big, and the error too unspecific to upload to an issue, if necesary it could be uploaded to Github.

Meta

rustc --version --verbose:

rustc 1.70.0-nightly (2036fdd24 2023-03-27)
binary: rustc
commit-hash: 2036fdd24f77d607dcfaa24c48fbe85d3f785823
commit-date: 2023-03-27
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 16.0.0

Error output

[<output>](error: internal compiler error: /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/compiler/rustc_codegen_ssa/src/mir/rvalue.rs:892:22: Couldn't translate Aggregate { sized: true } as backend immediate)
Backtrace

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/compiler/rustc_errors/src/lib.rs:1644:9
stack backtrace:
   0:     0x7f1cea42bf8a - std::backtrace_rs::backtrace::libunwind::trace::h543e5a71eb1b5eeb
                               at /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f1cea42bf8a - std::backtrace_rs::backtrace::trace_unsynchronized::h8798c87c5fd54c42
                               at /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f1cea42bf8a - std::sys_common::backtrace::_print_fmt::h982e629a02833f3b
                               at /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f1cea42bf8a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd16097abfc45a49a
                               at /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f1cea49004f - core::fmt::write::haccd80b41eab472e
                               at /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/library/core/src/fmt/mod.rs:1254:17
   5:     0x7f1cea41ebc5 - std::io::Write::write_fmt::h578b3def4330fd2b
                               at /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/library/std/src/io/mod.rs:1698:15
   6:     0x7f1cea42bd55 - std::sys_common::backtrace::_print::he237786f41276d1a
                               at /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f1cea42bd55 - std::sys_common::backtrace::print::h504fa2bef175cc1e
                               at /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f1cea42e9fe - std::panicking::default_hook::{{closure}}::hac9a65d5f66db25e
                               at /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/library/std/src/panicking.rs:269:22
   9:     0x7f1cea42e7a5 - std::panicking::default_hook::h4e334937c58bdca9
                               at /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/library/std/src/panicking.rs:288:9
  10:     0x7f1ced739635 - rustc_driver_impl[bd452c501c51eef0]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f1cea42f1f4 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h2c058cd2c0afd653
                               at /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/library/alloc/src/boxed.rs:1990:9
  12:     0x7f1cea42f1f4 - std::panicking::rust_panic_with_hook::h1fcbef96fdc6ec0c
                               at /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/library/std/src/panicking.rs:694:13
  13:     0x7f1cedc8bef1 - std[1137eeb067dcff5d]::panicking::begin_panic::<rustc_errors[b273ccddd230f82e]::ExplicitBug>::{closure#0}
  14:     0x7f1cedc87e06 - std[1137eeb067dcff5d]::sys_common::backtrace::__rust_end_short_backtrace::<std[1137eeb067dcff5d]::panicking::begin_panic<rustc_errors[b273ccddd230f82e]::ExplicitBug>::{closure#0}, !>
  15:     0x7f1cedc87d96 - std[1137eeb067dcff5d]::panicking::begin_panic::<rustc_errors[b273ccddd230f82e]::ExplicitBug>
  16:     0x7f1cedcdc876 - <rustc_errors[b273ccddd230f82e]::HandlerInner>::bug::<&alloc[facd9c3565c23052]::string::String>
  17:     0x7f1cedcdc540 - <rustc_errors[b273ccddd230f82e]::Handler>::bug::<&alloc[facd9c3565c23052]::string::String>
  18:     0x7f1cedcd5eab - rustc_middle[b98cfd31c7bf31fd]::util::bug::opt_span_bug_fmt::<rustc_span[b847b06bcddf9aef]::span_encoding::Span>::{closure#0}
  19:     0x7f1cedcd5a3a - rustc_middle[b98cfd31c7bf31fd]::ty::context::tls::with_opt::<rustc_middle[b98cfd31c7bf31fd]::util::bug::opt_span_bug_fmt<rustc_span[b847b06bcddf9aef]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  20:     0x7f1cedcd5a06 - rustc_middle[b98cfd31c7bf31fd]::ty::context::tls::with_context_opt::<rustc_middle[b98cfd31c7bf31fd]::ty::context::tls::with_opt<rustc_middle[b98cfd31c7bf31fd]::util::bug::opt_span_bug_fmt<rustc_span[b847b06bcddf9aef]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  21:     0x7f1cedcd5df6 - rustc_middle[b98cfd31c7bf31fd]::util::bug::opt_span_bug_fmt::<rustc_span[b847b06bcddf9aef]::span_encoding::Span>
  22:     0x7f1ceb971033 - rustc_middle[b98cfd31c7bf31fd]::util::bug::bug_fmt
  23:     0x7f1cebf4debd - rustc_codegen_ssa[908d924d1a0e06ad]::mir::analyze::non_ssa_locals::<rustc_codegen_llvm[b01ba7ae6a55fff3]::builder::Builder>
  24:     0x7f1cebf1e967 - rustc_codegen_ssa[908d924d1a0e06ad]::mir::codegen_mir::<rustc_codegen_llvm[b01ba7ae6a55fff3]::builder::Builder>
  25:     0x7f1cecc858ee - rustc_codegen_llvm[b01ba7ae6a55fff3]::base::compile_codegen_unit::module_codegen
  26:     0x7f1cecc84ba6 - rustc_codegen_llvm[b01ba7ae6a55fff3]::base::compile_codegen_unit
  27:     0x7f1cecce2954 - rustc_codegen_ssa[908d924d1a0e06ad]::base::codegen_crate::<rustc_codegen_llvm[b01ba7ae6a55fff3]::LlvmCodegenBackend>
  28:     0x7f1cecce226a - <rustc_codegen_llvm[b01ba7ae6a55fff3]::LlvmCodegenBackend as rustc_codegen_ssa[908d924d1a0e06ad]::traits::backend::CodegenBackend>::codegen_crate
  29:     0x7f1cec98d202 - <rustc_session[8a142d07c6ec552f]::session::Session>::time::<alloc[facd9c3565c23052]::boxed::Box<dyn core[d2a11d220902df1]::any::Any>, rustc_interface[c7956fe9641ea70c]::passes::start_codegen::{closure#0}>
  30:     0x7f1cec98cccd - rustc_interface[c7956fe9641ea70c]::passes::start_codegen
  31:     0x7f1cec987c54 - <rustc_middle[b98cfd31c7bf31fd]::ty::context::GlobalCtxt>::enter::<<rustc_interface[c7956fe9641ea70c]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[d2a11d220902df1]::result::Result<alloc[facd9c3565c23052]::boxed::Box<dyn core[d2a11d220902df1]::any::Any>, rustc_span[b847b06bcddf9aef]::ErrorGuaranteed>>
  32:     0x7f1cec986028 - <rustc_interface[c7956fe9641ea70c]::queries::Queries>::ongoing_codegen
  33:     0x7f1cec985834 - <rustc_interface[c7956fe9641ea70c]::interface::Compiler>::enter::<rustc_driver_impl[bd452c501c51eef0]::run_compiler::{closure#1}::{closure#2}, core[d2a11d220902df1]::result::Result<core[d2a11d220902df1]::option::Option<rustc_interface[c7956fe9641ea70c]::queries::Linker>, rustc_span[b847b06bcddf9aef]::ErrorGuaranteed>>
  34:     0x7f1cec980ae1 - rustc_span[b847b06bcddf9aef]::set_source_map::<core[d2a11d220902df1]::result::Result<(), rustc_span[b847b06bcddf9aef]::ErrorGuaranteed>, rustc_interface[c7956fe9641ea70c]::interface::run_compiler<core[d2a11d220902df1]::result::Result<(), rustc_span[b847b06bcddf9aef]::ErrorGuaranteed>, rustc_driver_impl[bd452c501c51eef0]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  35:     0x7f1cec98008f - std[1137eeb067dcff5d]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[c7956fe9641ea70c]::util::run_in_thread_pool_with_globals<rustc_interface[c7956fe9641ea70c]::interface::run_compiler<core[d2a11d220902df1]::result::Result<(), rustc_span[b847b06bcddf9aef]::ErrorGuaranteed>, rustc_driver_impl[bd452c501c51eef0]::run_compiler::{closure#1}>::{closure#0}, core[d2a11d220902df1]::result::Result<(), rustc_span[b847b06bcddf9aef]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d2a11d220902df1]::result::Result<(), rustc_span[b847b06bcddf9aef]::ErrorGuaranteed>>
  36:     0x7f1cecfed8b1 - <<std[1137eeb067dcff5d]::thread::Builder>::spawn_unchecked_<rustc_interface[c7956fe9641ea70c]::util::run_in_thread_pool_with_globals<rustc_interface[c7956fe9641ea70c]::interface::run_compiler<core[d2a11d220902df1]::result::Result<(), rustc_span[b847b06bcddf9aef]::ErrorGuaranteed>, rustc_driver_impl[bd452c501c51eef0]::run_compiler::{closure#1}>::{closure#0}, core[d2a11d220902df1]::result::Result<(), rustc_span[b847b06bcddf9aef]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d2a11d220902df1]::result::Result<(), rustc_span[b847b06bcddf9aef]::ErrorGuaranteed>>::{closure#1} as core[d2a11d220902df1]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  37:     0x7f1cea4392d5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hcb3c543eabd3883a
                               at /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/library/alloc/src/boxed.rs:1976:9
  38:     0x7f1cea4392d5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4c6155c5f5f14f7d
                               at /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/library/alloc/src/boxed.rs:1976:9
  39:     0x7f1cea4392d5 - std::sys::unix::thread::Thread::new::thread_start::he5347f8288d9936e
                               at /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/library/std/src/sys/unix/thread.rs:108:17
  40:     0x7f1cea2f5609 - start_thread
                               at /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8
  41:     0x7f1cea218133 - clone
                               at /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  42:                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: rustc 1.70.0-nightly (2eaeb1eee 2023-04-05) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C opt-level=3 -C embed-bitcode=no -C debuginfo=2 -C link-arg=--nmagic -C link-arg=-Tlink.x -C link-arg=-Tlink-rp.x -C link-arg=-Tdefmt.x

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack

@spcan spcan added C-bug Category: This is a bug. 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. labels Apr 7, 2023
@spcan
Copy link
Author

spcan commented Apr 7, 2023

Relevant information: compiling for an embedded target (RP2040) with the following features enabled.

#![no_std]
#![no_main]


#![feature(const_cmp)]
#![feature(const_for)]
#![feature(const_try)]
#![feature(const_convert)]
#![feature(const_mut_refs)]
#![feature(const_trait_impl)]
#![feature(type_alias_impl_trait)]
#![feature(const_intoiterator_identity)]

@compiler-errors
Copy link
Member

This is a duplicate of #109992

@scottmcm
Copy link
Member

scottmcm commented Apr 7, 2023

This is caused by a ZST-to-ZST transmute that the MIR optimization don't remove. Fix is up in #110021.

@jyn514 jyn514 changed the title [ICE] Compiler Error after updating to nightly 1.70 [ICE] Couldn't translate Aggregate { sized: true } as backend immediate Apr 7, 2023
@jyn514
Copy link
Member

jyn514 commented Apr 7, 2023

Closing as a duplicate of #109992.

@jyn514 jyn514 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 7, 2023
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Apr 10, 2023
…rors

Fix a couple ICEs in the new `CastKind::Transmute` code

Check the sizes of the immediates, rather than the overall types, when deciding whether we can convert types without going through memory.

Fixes rust-lang#110005
Fixes rust-lang#109992
Fixes rust-lang#110032
cc `@matthiaskrgr`
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) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants