Skip to content

ICE None abi map #142969

Closed
Closed
@matthiaskrgr

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

const extern "C-cmse-nonsecure-call" fn foo() {
    panic!()
}

const _: () = foo();

original:

//@ dont-require-annotations: NOTE

const extern "C-cmse-nonsecure-call" fn foo() {
    panic!() //~ NOTE inside `foo`
}

const _: () = foo(); //~ ERROR explicit panic
// Ensure that the CTFE engine handles calls to `extern "C"` aborting gracefully

fn main() {
    foo();
}

Version information

rustc 1.90.0-nightly (36b21637e 2025-06-24)
binary: rustc
commit-hash: 36b21637e93b038453924d3c66821089e71d8baa
commit-date: 2025-06-24
host: x86_64-unknown-linux-gnu
release: 1.90.0-nightly
LLVM version: 20.1.7

Possibly related line of code:

} else {
(None, None, false)
};
let sig = tcx.normalize_erasing_regions(cx.typing_env, sig);
let abi_map = AbiMap::from_target(&tcx.sess.target);
let conv = abi_map.canonize_abi(sig.abi, sig.c_variadic).unwrap();
let mut inputs = sig.inputs();
let extra_args = if sig.abi == ExternAbi::RustCall {
assert!(!sig.c_variadic && extra_args.is_empty());
if let Some(input) = sig.inputs().last()

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error[E0570]: "C-cmse-nonsecure-call" is not a supported ABI for the current target
 --> /tmp/icemaker_global_tempdir.ULTgWIcdXIKD/rustc_testrunner_tmpdir_reporting.glpfjhmoWab2/mvce.rs:1:14
  |
1 | const extern "C-cmse-nonsecure-call" fn foo() {
  |              ^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: the extern "C-cmse-nonsecure-call" ABI is experimental and subject to change
 --> /tmp/icemaker_global_tempdir.ULTgWIcdXIKD/rustc_testrunner_tmpdir_reporting.glpfjhmoWab2/mvce.rs:1:14
  |
1 | const extern "C-cmse-nonsecure-call" fn foo() {
  |              ^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #81391 <https://github.com/rust-lang/rust/issues/81391> for more information
  = help: add `#![feature(abi_c_cmse_nonsecure_call)]` to the crate attributes to enable
  = note: this compiler was built on 2025-06-24; consider upgrading it if it is out of date

error[E0601]: `main` function not found in crate `mvce`
 --> /tmp/icemaker_global_tempdir.ULTgWIcdXIKD/rustc_testrunner_tmpdir_reporting.glpfjhmoWab2/mvce.rs:5:21
  |
5 | const _: () = foo();
  |                     ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.ULTgWIcdXIKD/rustc_testrunner_tmpdir_reporting.glpfjhmoWab2/mvce.rs`

error[E0781]: the `"C-cmse-nonsecure-call"` ABI is only allowed on function pointers
 --> /tmp/icemaker_global_tempdir.ULTgWIcdXIKD/rustc_testrunner_tmpdir_reporting.glpfjhmoWab2/mvce.rs:1:1
  |
1 | const extern "C-cmse-nonsecure-call" fn foo() {
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


thread 'rustc' panicked at compiler/rustc_ty_utils/src/abi.rs:485:62:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:     0x7e88216d04c3 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hcdf1d57453f7287d
   1:     0x7e8821e02bbf - core::fmt::write::h3be3172487877823
   2:     0x7e88216c60f3 - std::io::Write::write_fmt::hff7ec47b7aff581e
   3:     0x7e88216d0322 - std::sys::backtrace::BacktraceLock::print::h7248a2e68b1a6757
   4:     0x7e88216d3e1a - std::panicking::default_hook::{{closure}}::hb6197d3c009db5db
   5:     0x7e88216d399f - std::panicking::default_hook::h48f8973c358ad080
   6:     0x7e88207c8453 - std[68493ca0f26471a7]::panicking::update_hook::<alloc[f83a11adcbc54e04]::boxed::Box<rustc_driver_impl[f4fefd20ab752313]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x7e88216d466b - std::panicking::rust_panic_with_hook::h2156d918f1b4687a
   8:     0x7e88216d4336 - std::panicking::begin_panic_handler::{{closure}}::h72af41ccef8ec229
   9:     0x7e88216d0989 - std::sys::backtrace::__rust_end_short_backtrace::ha354a46c9098f853
  10:     0x7e88216d404d - __rustc[5129e938e0a6cb40]::rust_begin_unwind
  11:     0x7e881de90a70 - core::panicking::panic_fmt::h0abade0315de1f17
  12:     0x7e881e2805fc - core::panicking::panic::h0271021f50f62f43
  13:     0x7e881de925f9 - core::option::unwrap_failed::h30cd3799589479e5
  14:     0x7e88222983ad - rustc_ty_utils[a31d89204f73f37b]::abi::fn_abi_new_uncached
  15:     0x7e882228b79f - rustc_ty_utils[a31d89204f73f37b]::abi::fn_abi_of_instance
  16:     0x7e882228acbc - rustc_query_impl[95c5a992c659fc75]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[95c5a992c659fc75]::query_impl::fn_abi_of_instance::dynamic_query::{closure#2}::{closure#0}, rustc_middle[9edb0a36796baa35]::query::erase::Erased<[u8; 16usize]>>
  17:     0x7e8822ca1b5f - rustc_query_system[67a3e20ccf3ba293]::query::plumbing::try_execute_query::<rustc_query_impl[95c5a992c659fc75]::DynamicConfig<rustc_query_system[67a3e20ccf3ba293]::query::caches::DefaultCache<rustc_middle[9edb0a36796baa35]::ty::PseudoCanonicalInput<(rustc_middle[9edb0a36796baa35]::ty::instance::Instance, &rustc_middle[9edb0a36796baa35]::ty::list::RawList<(), rustc_middle[9edb0a36796baa35]::ty::Ty>)>, rustc_middle[9edb0a36796baa35]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[95c5a992c659fc75]::plumbing::QueryCtxt, false>
  18:     0x7e8822ca1706 - rustc_query_impl[95c5a992c659fc75]::query_impl::fn_abi_of_instance::get_query_non_incr::__rust_end_short_backtrace
  19:     0x7e8822bd79ba - <rustc_const_eval[5fc3aaa4387721cf]::interpret::eval_context::InterpCx<rustc_const_eval[5fc3aaa4387721cf]::const_eval::machine::CompileTimeMachine>>::eval_callee_and_args
  20:     0x7e8822be9c54 - rustc_const_eval[5fc3aaa4387721cf]::const_eval::eval_queries::eval_to_allocation_raw_provider
  21:     0x7e8822be8bfe - rustc_query_impl[95c5a992c659fc75]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[95c5a992c659fc75]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[9edb0a36796baa35]::query::erase::Erased<[u8; 24usize]>>
  22:     0x7e8822b8fac5 - rustc_query_system[67a3e20ccf3ba293]::query::plumbing::try_execute_query::<rustc_query_impl[95c5a992c659fc75]::DynamicConfig<rustc_query_system[67a3e20ccf3ba293]::query::caches::DefaultCache<rustc_middle[9edb0a36796baa35]::ty::PseudoCanonicalInput<rustc_middle[9edb0a36796baa35]::mir::interpret::GlobalId>, rustc_middle[9edb0a36796baa35]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[95c5a992c659fc75]::plumbing::QueryCtxt, false>
  23:     0x7e8822b8f689 - rustc_query_impl[95c5a992c659fc75]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
  24:     0x7e8822b8cd44 - rustc_const_eval[5fc3aaa4387721cf]::const_eval::eval_queries::eval_to_const_value_raw_provider
  25:     0x7e8822b8cb40 - rustc_query_impl[95c5a992c659fc75]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[95c5a992c659fc75]::query_impl::eval_to_const_value_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[9edb0a36796baa35]::query::erase::Erased<[u8; 24usize]>>
  26:     0x7e8822b8b4f5 - rustc_query_system[67a3e20ccf3ba293]::query::plumbing::try_execute_query::<rustc_query_impl[95c5a992c659fc75]::DynamicConfig<rustc_query_system[67a3e20ccf3ba293]::query::caches::DefaultCache<rustc_middle[9edb0a36796baa35]::ty::PseudoCanonicalInput<rustc_middle[9edb0a36796baa35]::mir::interpret::GlobalId>, rustc_middle[9edb0a36796baa35]::query::erase::Erased<[u8; 24usize]>>, false, true, false>, rustc_query_impl[95c5a992c659fc75]::plumbing::QueryCtxt, false>
  27:     0x7e8822b8b095 - rustc_query_impl[95c5a992c659fc75]::query_impl::eval_to_const_value_raw::get_query_non_incr::__rust_end_short_backtrace
  28:     0x7e882207654e - rustc_hir_analysis[268b9673bc54c5af]::check_crate
  29:     0x7e882207a527 - rustc_interface[560a13d527eaa050]::passes::analysis
  30:     0x7e882207a14b - rustc_query_impl[95c5a992c659fc75]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[95c5a992c659fc75]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[9edb0a36796baa35]::query::erase::Erased<[u8; 0usize]>>
  31:     0x7e8822e886fc - rustc_query_system[67a3e20ccf3ba293]::query::plumbing::try_execute_query::<rustc_query_impl[95c5a992c659fc75]::DynamicConfig<rustc_query_system[67a3e20ccf3ba293]::query::caches::SingleCache<rustc_middle[9edb0a36796baa35]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[95c5a992c659fc75]::plumbing::QueryCtxt, false>
  32:     0x7e8822e883d2 - rustc_query_impl[95c5a992c659fc75]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  33:     0x7e88230302d6 - rustc_interface[560a13d527eaa050]::passes::create_and_enter_global_ctxt::<core[af7c1b4cbcc1bab2]::option::Option<rustc_interface[560a13d527eaa050]::queries::Linker>, rustc_driver_impl[f4fefd20ab752313]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  34:     0x7e882309f265 - rustc_interface[560a13d527eaa050]::interface::run_compiler::<(), rustc_driver_impl[f4fefd20ab752313]::run_compiler::{closure#0}>::{closure#1}
  35:     0x7e882304ef38 - std[68493ca0f26471a7]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[560a13d527eaa050]::util::run_in_thread_with_globals<rustc_interface[560a13d527eaa050]::util::run_in_thread_pool_with_globals<rustc_interface[560a13d527eaa050]::interface::run_compiler<(), rustc_driver_impl[f4fefd20ab752313]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  36:     0x7e882304ec16 - <<std[68493ca0f26471a7]::thread::Builder>::spawn_unchecked_<rustc_interface[560a13d527eaa050]::util::run_in_thread_with_globals<rustc_interface[560a13d527eaa050]::util::run_in_thread_pool_with_globals<rustc_interface[560a13d527eaa050]::interface::run_compiler<(), rustc_driver_impl[f4fefd20ab752313]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[af7c1b4cbcc1bab2]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  37:     0x7e882304d23d - std::sys::pal::unix::thread::Thread::new::thread_start::h9b8f8a41fab5b847
  38:     0x7e881caa57eb - <unknown>
  39:     0x7e881cb2918c - <unknown>
  40:                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.90.0-nightly (36b21637e 2025-06-24) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [fn_abi_of_instance] computing call ABI of `foo`
#1 [eval_to_allocation_raw] const-evaluating + checking `_`
#2 [eval_to_const_value_raw] simplifying constant for the type system `_`
#3 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 4 previous errors

Some errors have detailed explanations: E0570, E0601, E0658, E0781.
For more information about an error, try `rustc --explain E0570`.

Metadata

Metadata

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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions