Skip to content

ICE: fn_abi_of_instance(Instance { def: Item(DefId(0:195 ~ bigty[1d5a]::foo)), args: [] }) failed #148853

Description

@Paladynee

this is a type of size 2^63, but hear me out i have a reason to need such a big type.
i am trying to find cases whether &raw const (*struct).field would cause arithmetic overflow in the generated assembly, and while testing this 2^63 size type i encountered an ICE.

Code

fn main() {}

#[repr(C)]
pub struct Big(pub [u8; 1 << 63]);

#[unsafe(no_mangle)]
pub extern "C" fn foo(x: Big) {}

Meta

rustc --version --verbose:

rustc 1.93.0-nightly (25d319a0f 2025-11-11)
binary: rustc
commit-hash: 25d319a0f656ee8faa7a534da299e76e96068a40
commit-date: 2025-11-11
host: x86_64-unknown-linux-gnu
release: 1.93.0-nightly
LLVM version: 21.1.5

Error output

error: internal compiler error: compiler/rustc_codegen_ssa/src/back/symbol_export.rs:631:33: fn_abi_of_instance(Instance { def: Item(DefId(0:8 ~ bigty[6430]::foo)), args: [] }) failed
Backtrace

eurydice@fedora:~/coreign/bigty$ RUST_BACTRACE=1 cargo build
   Compiling bigty v0.1.0 (/home/eurydice/coreign/bigty)
warning: unused variable: `x`
 --> src/main.rs:7:23
  |
7 | pub extern "C" fn foo(x: Big) {}
  |                       ^ help: if this is intentional, prefix it with an underscore: `_x`
  |
  = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default

error: internal compiler error: compiler/rustc_codegen_ssa/src/back/symbol_export.rs:631:33: fn_abi_of_instance(Instance { def: Item(DefId(0:8 ~ bigty[6430]::foo)), args: [] }) failed


thread 'rustc' (172001) panicked at compiler/rustc_codegen_ssa/src/back/symbol_export.rs:631:33:
Box<dyn Any>
stack backtrace:
   0:     0x7f1c3f46d3e3 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h0633a1facea2fecc
   1:     0x7f1c3fc01afc - core::fmt::write::h9a15bf066211dcb4
   2:     0x7f1c3f421e73 - std::io::Write::write_fmt::hff379e6e597ceaa8
   3:     0x7f1c3f433372 - std::sys::backtrace::BacktraceLock::print::hb5ddcb6e9b97390c
   4:     0x7f1c3f439509 - std::panicking::default_hook::{{closure}}::he8f9cd80ce5a2a50
   5:     0x7f1c3f439033 - std::panicking::default_hook::h8656f8f92080f5f7
   6:     0x7f1c3e428711 - std[721bedb690e2790c]::panicking::update_hook::<alloc[c10568e586b709ee]::boxed::Box<rustc_driver_impl[38d33047c40bfbf1]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x7f1c3f43992b - std::panicking::panic_with_hook::h66430e0c4e9a33c7
   8:     0x7f1c3e464c81 - std[721bedb690e2790c]::panicking::begin_panic::<rustc_errors[831fbc4af86babf3]::ExplicitBug>::{closure#0}
   9:     0x7f1c3e457126 - std[721bedb690e2790c]::sys::backtrace::__rust_end_short_backtrace::<std[721bedb690e2790c]::panicking::begin_panic<rustc_errors[831fbc4af86babf3]::ExplicitBug>::{closure#0}, !>
  10:     0x7f1c3e456f27 - std[721bedb690e2790c]::panicking::begin_panic::<rustc_errors[831fbc4af86babf3]::ExplicitBug>
  11:     0x7f1c3e483491 - <rustc_errors[831fbc4af86babf3]::diagnostic::BugAbort as rustc_errors[831fbc4af86babf3]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x7f1c3ea0ecba - rustc_middle[aa8c650dcd59263]::util::bug::opt_span_bug_fmt::<rustc_span[783247162d06ce1a]::span_encoding::Span>::{closure#0}
  13:     0x7f1c3ea0ef9a - rustc_middle[aa8c650dcd59263]::ty::context::tls::with_opt::<rustc_middle[aa8c650dcd59263]::util::bug::opt_span_bug_fmt<rustc_span[783247162d06ce1a]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x7f1c3e9ffd9b - rustc_middle[aa8c650dcd59263]::ty::context::tls::with_context_opt::<rustc_middle[aa8c650dcd59263]::ty::context::tls::with_opt<rustc_middle[aa8c650dcd59263]::util::bug::opt_span_bug_fmt<rustc_span[783247162d06ce1a]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:     0x7f1c3c5bc1a0 - rustc_middle[aa8c650dcd59263]::util::bug::bug_fmt
  16:     0x7f1c41cb6e2a - rustc_codegen_ssa[f43f888309ac4b95]::back::symbol_export::calling_convention_for_symbol.cold
  17:     0x7f1c40b09ced - <rustc_codegen_ssa[f43f888309ac4b95]::CrateInfo>::new
  18:     0x7f1c40faf875 - rustc_codegen_ssa[f43f888309ac4b95]::base::codegen_crate::<rustc_codegen_llvm[6e1599dbaae2b107]::LlvmCodegenBackend>
  19:     0x7f1c40faf4cf - <rustc_codegen_llvm[6e1599dbaae2b107]::LlvmCodegenBackend as rustc_codegen_ssa[f43f888309ac4b95]::traits::backend::CodegenBackend>::codegen_crate
  20:     0x7f1c40ebf84d - <rustc_interface[a2dcb7d1cb973a8b]::queries::Linker>::codegen_and_build_linker
  21:     0x7f1c40ebc40d - <rustc_interface[a2dcb7d1cb973a8b]::passes::create_and_enter_global_ctxt<core[151ae80cb6bf969]::option::Option<rustc_interface[a2dcb7d1cb973a8b]::queries::Linker>, rustc_driver_impl[38d33047c40bfbf1]::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core[151ae80cb6bf969]::ops::function::FnOnce<(&rustc_session[482e14dbb9a081c0]::session::Session, rustc_middle[aa8c650dcd59263]::ty::context::CurrentGcx, alloc[c10568e586b709ee]::sync::Arc<rustc_data_structures[24bee38d34be977f]::jobserver::Proxy>, &std[721bedb690e2790c]::sync::once_lock::OnceLock<rustc_middle[aa8c650dcd59263]::ty::context::GlobalCtxt>, &rustc_data_structures[24bee38d34be977f]::sync::worker_local::WorkerLocal<rustc_middle[aa8c650dcd59263]::arena::Arena>, &rustc_data_structures[24bee38d34be977f]::sync::worker_local::WorkerLocal<rustc_hir[cd2c4c8f0b84acf2]::Arena>, rustc_driver_impl[38d33047c40bfbf1]::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  22:     0x7f1c40daf169 - rustc_interface[a2dcb7d1cb973a8b]::interface::run_compiler::<(), rustc_driver_impl[38d33047c40bfbf1]::run_compiler::{closure#0}>::{closure#1}
  23:     0x7f1c40d3af47 - std[721bedb690e2790c]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[a2dcb7d1cb973a8b]::util::run_in_thread_with_globals<rustc_interface[a2dcb7d1cb973a8b]::util::run_in_thread_pool_with_globals<rustc_interface[a2dcb7d1cb973a8b]::interface::run_compiler<(), rustc_driver_impl[38d33047c40bfbf1]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  24:     0x7f1c40d3ac28 - <<std[721bedb690e2790c]::thread::Builder>::spawn_unchecked_<rustc_interface[a2dcb7d1cb973a8b]::util::run_in_thread_with_globals<rustc_interface[a2dcb7d1cb973a8b]::util::run_in_thread_pool_with_globals<rustc_interface[a2dcb7d1cb973a8b]::interface::run_compiler<(), rustc_driver_impl[38d33047c40bfbf1]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[151ae80cb6bf969]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  25:     0x7f1c40d40e2f - std::sys::thread::unix::Thread::new::thread_start::h097287e8696c2c93
  26:     0x7f1c3a67ff54 - start_thread
  27:     0x7f1c3a70332c - __GI___clone3
  28:                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 `/home/eurydice/coreign/bigty/rustc-ice-2025-11-12T03_53_47-171999.txt` to your bug report

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
end of query stack
warning: `bigty` (bin "bigty") generated 1 warning (run `cargo fix --bin "bigty" -p bigty` to apply 1 suggestion)
error: could not compile `bigty` (bin "bigty"); 1 warning emitted

Caused by:
  process didn't exit successfully: `/home/eurydice/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc --crate-name bigty --edition=2024 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=182 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=facf25b5ea4fd0cb -C extra-filename=-b01baa4f1fa1e53a --out-dir /home/eurydice/coreign/bigty/target/debug/deps -C incremental=/home/eurydice/coreign/bigty/target/debug/incremental -L dependency=/home/eurydice/coreign/bigty/target/debug/deps` (exit status: 101)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions