Skip to content

ICE: abi_map: None #142107

@matthiaskrgr

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

//@compile-flags: -Clink-dead-code=true #![feature(extended_varargs_abi_support)] fn aapcs(f: extern "aapcs" fn(usize, ...)) { f(22, 44); } fn main() {}

original:

//@ only-arm //@ build-pass #![allow(named_arguments_used_positionally)] fn aapcs(f: extern "aapcs" fn(usize, ...)) { f(22, 44); } fn main() {}

Version information

rustc 1.89.0-nightly (cf423712b 2025-06-05) binary: rustc commit-hash: cf423712b9e95e9f6ec84b1ecb3d125e55ac8d56 commit-date: 2025-06-05 host: x86_64-unknown-linux-gnu release: 1.89.0-nightly LLVM version: 20.1.5 

Possibly related line of code:

Self::Direct(abi) | Self::Deprecated(abi) => Some(abi),
Self::Invalid => None,
}
}
pub fn unwrap(self) -> CanonAbi {
self.into_option().unwrap()
}
pub fn is_mapped(self) -> bool {
self.into_option().is_some()
}
}

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Clink-dead-code=true -Zcrate-attr=feature(extended_varargs_abi_support)

Program output

warning: the calling convention "aapcs" is not supported on this target --> /tmp/icemaker_global_tempdir.H2Ee9GDZaH3Q/rustc_testrunner_tmpdir_reporting.Q8z8e0R93hNQ/mvce.rs:1:13 | 1 | fn aapcs(f: extern "aapcs" fn(usize, ...)) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> = note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default warning: function `aapcs` is never used --> /tmp/icemaker_global_tempdir.H2Ee9GDZaH3Q/rustc_testrunner_tmpdir_reporting.Q8z8e0R93hNQ/mvce.rs:1:4 | 1 | fn aapcs(f: extern "aapcs" fn(usize, ...)) { | ^^^^^ | = note: `#[warn(dead_code)]` on by default thread 'rustc' panicked at compiler/rustc_target/src/spec/abi_map.rs:33:28: called `Option::unwrap()` on a `None` value stack backtrace: 0: 0x741a3b4649e3 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h2c72d8464c6e7078 1: 0x741a3bc029f7 - core::fmt::write::h57fa85e1fefbdee0 2: 0x741a3b45a753 - std::io::Write::write_fmt::hde18502dccfe8387 3: 0x741a3b464842 - std::sys::backtrace::BacktraceLock::print::h142f1f2eb047aa28 4: 0x741a3b46843a - std::panicking::default_hook::{{closure}}::h3ea40447870cd95c 5: 0x741a3b467fbf - std::panicking::default_hook::h75e0b809b03fc60c 6: 0x741a3a55d303 - std[126408c7f9fb25ab]::panicking::update_hook::<alloc[60ccada38a9f8a3b]::boxed::Box<rustc_driver_impl[9e08e94f90f4707c]::install_ice_hook::{closure#1}>>::{closure#0} 7: 0x741a3b468cb3 - std::panicking::rust_panic_with_hook::hd9a1e74d4ae3efb9 8: 0x741a3b468976 - std::panicking::begin_panic_handler::{{closure}}::h934ad1bd7ef79922 9: 0x741a3b464eb9 - std::sys::backtrace::__rust_end_short_backtrace::hf7dfbc47684e5044 10: 0x741a3b46866d - __rustc[3c591ca183ed768b]::rust_begin_unwind 11: 0x741a37c74bc0 - core::panicking::panic_fmt::hc5cfb34418404b01 12: 0x741a37eb986c - core::panicking::panic::h433cf0f2be091102 13: 0x741a37c76519 - core::option::unwrap_failed::h380d4c1c07e438b4 14: 0x741a3c1a831b - rustc_ty_utils[74b2f05863926281]::abi::fn_abi_new_uncached 15: 0x741a3c1a05e7 - rustc_ty_utils[74b2f05863926281]::abi::fn_abi_of_fn_ptr 16: 0x741a3c1a057a - rustc_query_impl[2ece3ecac821dbcb]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2ece3ecac821dbcb]::query_impl::fn_abi_of_fn_ptr::dynamic_query::{closure#2}::{closure#0}, rustc_middle[2dfb1ec257bea9a6]::query::erase::Erased<[u8; 16usize]>> 17: 0x741a3c1a0539 - <rustc_query_impl[2ece3ecac821dbcb]::query_impl::fn_abi_of_fn_ptr::dynamic_query::{closure#2} as core[dc170bfee6ea9f4c]::ops::function::FnOnce<(rustc_middle[2dfb1ec257bea9a6]::ty::context::TyCtxt, rustc_middle[2dfb1ec257bea9a6]::ty::PseudoCanonicalInput<(rustc_type_ir[981db32a513602bc]::binder::Binder<rustc_middle[2dfb1ec257bea9a6]::ty::context::TyCtxt, rustc_type_ir[981db32a513602bc]::ty_kind::FnSig<rustc_middle[2dfb1ec257bea9a6]::ty::context::TyCtxt>>, &rustc_middle[2dfb1ec257bea9a6]::ty::list::RawList<(), rustc_middle[2dfb1ec257bea9a6]::ty::Ty>)>)>>::call_once 18: 0x741a3cf93395 - rustc_query_system[b7defdb8b233bb23]::query::plumbing::try_execute_query::<rustc_query_impl[2ece3ecac821dbcb]::DynamicConfig<rustc_query_system[b7defdb8b233bb23]::query::caches::DefaultCache<rustc_middle[2dfb1ec257bea9a6]::ty::PseudoCanonicalInput<(rustc_type_ir[981db32a513602bc]::binder::Binder<rustc_middle[2dfb1ec257bea9a6]::ty::context::TyCtxt, rustc_type_ir[981db32a513602bc]::ty_kind::FnSig<rustc_middle[2dfb1ec257bea9a6]::ty::context::TyCtxt>>, &rustc_middle[2dfb1ec257bea9a6]::ty::list::RawList<(), rustc_middle[2dfb1ec257bea9a6]::ty::Ty>)>, rustc_middle[2dfb1ec257bea9a6]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[2ece3ecac821dbcb]::plumbing::QueryCtxt, false> 19: 0x741a3cf93006 - rustc_query_impl[2ece3ecac821dbcb]::query_impl::fn_abi_of_fn_ptr::get_query_non_incr::__rust_end_short_backtrace 20: 0x741a391acc7b - rustc_monomorphize[d4a7340d772456de]::mono_checks::check_mono_item 21: 0x741a3c564fa0 - rustc_query_impl[2ece3ecac821dbcb]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2ece3ecac821dbcb]::query_impl::check_mono_item::dynamic_query::{closure#2}::{closure#0}, rustc_middle[2dfb1ec257bea9a6]::query::erase::Erased<[u8; 0usize]>> 22: 0x741a3c5303b3 - rustc_query_system[b7defdb8b233bb23]::query::plumbing::try_execute_query::<rustc_query_impl[2ece3ecac821dbcb]::DynamicConfig<rustc_query_system[b7defdb8b233bb23]::query::caches::DefaultCache<rustc_middle[2dfb1ec257bea9a6]::ty::instance::Instance, rustc_middle[2dfb1ec257bea9a6]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[2ece3ecac821dbcb]::plumbing::QueryCtxt, false> 23: 0x741a3c530051 - rustc_query_impl[2ece3ecac821dbcb]::query_impl::check_mono_item::get_query_non_incr::__rust_end_short_backtrace 24: 0x741a3c53a554 - rustc_monomorphize[d4a7340d772456de]::collector::items_of_instance 25: 0x741a3c53a3f2 - rustc_query_impl[2ece3ecac821dbcb]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2ece3ecac821dbcb]::query_impl::items_of_instance::dynamic_query::{closure#2}::{closure#0}, rustc_middle[2dfb1ec257bea9a6]::query::erase::Erased<[u8; 32usize]>> 26: 0x741a3c5512eb - rustc_query_system[b7defdb8b233bb23]::query::plumbing::try_execute_query::<rustc_query_impl[2ece3ecac821dbcb]::DynamicConfig<rustc_query_system[b7defdb8b233bb23]::query::caches::DefaultCache<(rustc_middle[2dfb1ec257bea9a6]::ty::instance::Instance, rustc_middle[2dfb1ec257bea9a6]::mir::mono::CollectionMode), rustc_middle[2dfb1ec257bea9a6]::query::erase::Erased<[u8; 32usize]>>, false, false, false>, rustc_query_impl[2ece3ecac821dbcb]::plumbing::QueryCtxt, false> 27: 0x741a3c550f3f - rustc_query_impl[2ece3ecac821dbcb]::query_impl::items_of_instance::get_query_non_incr::__rust_end_short_backtrace 28: 0x741a3c554181 - rustc_monomorphize[d4a7340d772456de]::collector::collect_items_rec 29: 0x741a3c56ca61 - rustc_monomorphize[d4a7340d772456de]::collector::collect_crate_mono_items::{closure#1}::{closure#0} 30: 0x741a3c34d172 - rustc_monomorphize[d4a7340d772456de]::partitioning::collect_and_partition_mono_items 31: 0x741a3d000656 - rustc_query_impl[2ece3ecac821dbcb]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2ece3ecac821dbcb]::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2}::{closure#0}, rustc_middle[2dfb1ec257bea9a6]::query::erase::Erased<[u8; 40usize]>> 32: 0x741a3d000633 - <rustc_query_impl[2ece3ecac821dbcb]::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2} as core[dc170bfee6ea9f4c]::ops::function::FnOnce<(rustc_middle[2dfb1ec257bea9a6]::ty::context::TyCtxt, ())>>::call_once 33: 0x741a3d000163 - rustc_query_system[b7defdb8b233bb23]::query::plumbing::try_execute_query::<rustc_query_impl[2ece3ecac821dbcb]::DynamicConfig<rustc_query_system[b7defdb8b233bb23]::query::caches::SingleCache<rustc_middle[2dfb1ec257bea9a6]::query::erase::Erased<[u8; 40usize]>>, false, false, false>, rustc_query_impl[2ece3ecac821dbcb]::plumbing::QueryCtxt, false> 34: 0x741a3cffff03 - rustc_query_impl[2ece3ecac821dbcb]::query_impl::collect_and_partition_mono_items::get_query_non_incr::__rust_end_short_backtrace 35: 0x741a3cd04da6 - <rustc_codegen_llvm[74920c8061377519]::LlvmCodegenBackend as rustc_codegen_ssa[4ebb316766ae7b2b]::traits::backend::CodegenBackend>::codegen_crate 36: 0x741a3d0194a7 - <rustc_interface[1764bd4a174bd5e5]::queries::Linker>::codegen_and_build_linker 37: 0x741a3d0171b0 - rustc_interface[1764bd4a174bd5e5]::passes::create_and_enter_global_ctxt::<core[dc170bfee6ea9f4c]::option::Option<rustc_interface[1764bd4a174bd5e5]::queries::Linker>, rustc_driver_impl[9e08e94f90f4707c]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0} 38: 0x741a3ce633f0 - rustc_interface[1764bd4a174bd5e5]::interface::run_compiler::<(), rustc_driver_impl[9e08e94f90f4707c]::run_compiler::{closure#0}>::{closure#1} 39: 0x741a3ccc7c3e - std[126408c7f9fb25ab]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[1764bd4a174bd5e5]::util::run_in_thread_with_globals<rustc_interface[1764bd4a174bd5e5]::util::run_in_thread_pool_with_globals<rustc_interface[1764bd4a174bd5e5]::interface::run_compiler<(), rustc_driver_impl[9e08e94f90f4707c]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()> 40: 0x741a3ccc7916 - <<std[126408c7f9fb25ab]::thread::Builder>::spawn_unchecked_<rustc_interface[1764bd4a174bd5e5]::util::run_in_thread_with_globals<rustc_interface[1764bd4a174bd5e5]::util::run_in_thread_pool_with_globals<rustc_interface[1764bd4a174bd5e5]::interface::run_compiler<(), rustc_driver_impl[9e08e94f90f4707c]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[dc170bfee6ea9f4c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 41: 0x741a3ccc8ebd - std::sys::pal::unix::thread::Thread::new::thread_start::h5f39a95471057294 42: 0x741a368a57eb - <unknown> 43: 0x741a3692918c - <unknown> 44: 0x0 - <unknown> error: the compiler unexpectedly panicked. this is a bug. 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.89.0-nightly (cf423712b 2025-06-05) running on x86_64-unknown-linux-gnu note: compiler flags: -C link-dead-code=true -Z crate-attr=feature(extended_varargs_abi_support) -Z dump-mir-dir=dir query stack during panic: #0 [fn_abi_of_fn_ptr] computing call ABI of `extern "aapcs" fn(usize, ...)` function pointers #1 [check_mono_item] monomorphization-time checking #2 [items_of_instance] collecting items used by `aapcs` #3 [collect_and_partition_mono_items] collect_and_partition_mono_items end of query stack warning: 2 warnings emitted 

@rustbot label +F-extended_varargs_abi_support

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ABIArea: Concerning the application binary interface (ABI)C-bugCategory: This is a bug.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.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions